Downloads · 30 days
0
orianrivlin/chicago-crime-latitude-model
chicago-crime-latitude-model is a machine learning model from orianrivlin. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
https://www.youtube.com/watch?v=ASl7FbvRaSg
Downloads · 30 days
0
Access
Public
Updated Dec 9, 2025
Repo size
418 KB
Likes
0
Public
Click a slice to open those files.
.ipynb5.4 MB · 85%
From the Hugging Face model README
https://www.youtube.com/watch?v=ASl7FbvRaSg
Author: Orian Rivlin
Course: Data Science – Assignment #2
Goal: Build a complete ML pipeline – EDA, regression, feature engineering, clustering, improved models, classification, HF models, and insights.
This project uses a cleaned subset of the Chicago Crimes dataset (~19,500 rows) to build:
Target variables:
The dataset includes:
Final shape after cleaning: 19,496 rows × 22 columns





Model: Linear Regression with one‑hot encoded categorical features.
Latitude is nearly a linear function of the Y coordinate → high accuracy expected.

Added:
DistFromCenter)Applied K-Means (k=6) on scaled spatial & time data → added ClusterID.

Includes all engineered features + clustering.
An improvement over the baseline.

| Model | MAE | RMSE | R² |
|---|---|---|---|
| Baseline Linear Regression | 1.20e‑05 | 1.76e‑05 | 0.99999996 |
| Improved Linear Regression | 9.53e‑06 | 1.31e‑05 | 0.99999997 |
| Random Forest | 7.8e‑05 | 1.21e‑04 | 0.999998 |
| Gradient Boosting | 5.19e‑04 | 6.84e‑04 | 0.999938 |

Improved Linear Regression – simplest, fastest, most accurate.
Latitude divided into 3 balanced regions using 33% and 66% quantiles.
Classes:
Balanced distribution → accuracy is meaningful.

Accuracy: ~97%
Errors are between adjacent regions.

Accuracy: 100%

Accuracy: 100%
Gradient Boosting Classifier – perfect accuracy, compact, efficient.
A pickle file was exported:
best_classification_model.pkl
Contains: