← all researchcase file 07 / 07
DAT 490 · Data Science Capstone · Team project

Baltimore Crime Patterns

Applied AIFour-person team capstone.

450,000 crime records, three datasets, two questions: where does crime cluster, and can we predict what kind it will be?

/01dig

~450k

crime records, 2011–2024

/02dig

3

datasets merged

/03dig

0.62

strongest socioeconomic correlation

/04dig

~0.67

ROC-AUC, severity and weapon models

the questionwhy it matters

Open Baltimore publishes every reported incident. The team asked where crime hotspots are and how they track socioeconomic and seasonal factors, and whether the violent or non-violent, armed or unarmed nature of a crime can be predicted from its context.

Method

How it works

  1. step 1Merge

    Merge

    Crime incidents, crime-code descriptions and zip-code socioeconomic data joined into one table, using a cKDTree nearest-neighbor match on latitude and longitude.

  2. step 2Engineer

    Engineer

    Crime per capita, time-of-day bins, season, day of week, a weekend flag and a composite socioeconomic index.

  3. step 3Explain

    Explain

    Correlation analysis, OLS regression, ANOVA, K-means and DBSCAN clustering, choropleth maps, seasonal decomposition and Prophet forecasting.

  4. step 4Predict

    Predict

    Occurrence prediction had no negative examples, so the question was reframed as classifying severity and weapon use with logistic regression, random forests and XGBoost.

Figures
fig. 1tap to open
Choropleth map of crime density by zip code in Baltimore
Reported crimes by zip code, concentrated in central Baltimore.
Results

What it found

finding 1☥

01

Poverty rate, population density, unemployment, education and household income were the strongest correlates of crime per capita, up to about 0.62.

finding 2☥

02

Crime concentrates in central Baltimore, peaks in late summer and early fall, and is lowest in February.

finding 3☥

03

The severity and weapon classifiers reached moderate performance (ROC-AUC about 0.67); poverty rate, median income, hour of day and premise type were the top predictors.

the takeaway

“Where crime happens is well explained by context. What kind of crime it will be is much harder, and saying so honestly is part of the result.”

/tools

  • Python
  • pandas
  • scikit-learn
  • XGBoost
  • Prophet
  • geopandas
  • folium

Team coursework. The repository is private.

next case file