Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Community-Level Crime Data Analysis & Prediction Platform

An interactive web application for observational data exploration and linear regression modeling of violent crime rates using socioeconomic and demographic indicators across U.S. communities.

Important Note: The statistical associations in this application are observational and descriptive, not causal.


Context & Provenance

  • Project Context: Coursework project for Data Science (NYU Abu Dhabi).
  • Author: Ashmit Mukherjee.

Model Architecture & Evaluation

Feature Matrix & Target

The regression model evaluates 6 selected community socioeconomic indicators:

  1. medIncome – Median household income.
  2. racepctblack – Percentage Black population.
  3. racePctWhite – Percentage White population.
  4. racePctAsian – Percentage Asian population.
  5. racePctHisp – Percentage Hispanic population.
  6. PctRecImmig10 – Percentage of population who immigrated within the last 10 years.

Target Variable: ViolentCrimesPerPop (Violent crime rate per population).

Model Performance

Evaluated on an 80/20 single holdout test split (random_state=42):

  • Holdout Test $R^2$ Score: 0.48 (0.4845)
  • Training Set $R^2$ Score: 0.54

Dataset

  • Source: UCI Machine Learning Repository (Communities and Crime dataset).
  • Volume: 1,994 clean community observations (filtered from 2,215 raw records after missing-value removal on the 6 selected features + target).

Running Locally

# Clone the repository
git clone https://github.com/Ansester/crime-prediction-ml.git
cd crime-prediction-ml

# Install dependencies
pip install -r requirements.txt

# Launch the Streamlit application
streamlit run streamlit_app.py

Repository Structure

crime-prediction-ml/
├── streamlit_app.py       # Streamlit application with EDA & regression model
├── crimedata.csv         # Community crime dataset (2,215 raw records)
├── requirements.txt      # Python dependencies
├── LICENSE              # Repository license
└── README.md           # Project documentation

License

This repository's source code is licensed under the Apache License 2.0.

About

Streamlit app for socioeconomic crime-rate analysis and linear-regression prediction.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages