Live ML system that clusters 1,498 real accident records to identify hazard zones and predict risk by time, weather, and road type.





— Overview
What it is
Road safety in Kathmandu lacks data-driven infrastructure. This system ingests real accident records, applies DBSCAN clustering to surface 43 statistically significant hotspots, and layers a Random Forest model on top to predict risk given conditions like time of day, weather, and road type. The result is a live map interface that makes the patterns visible and actionable.
How I built it
DBSCAN was chosen over k-means because accident hotspots are irregularly shaped and vary in density — k-means would have forced arbitrary cluster boundaries. The Random Forest model was trained on engineered features from the accident records including hour bins, weather codes, and road classifications. The Django backend serves predictions via REST API, with Leaflet.js rendering the map and Chart.js handling the risk breakdowns.
— Stack
— Impact
1,498 real accident records processed and clustered
43 distinct hotspots identified across the dataset
Risk prediction by time, weather, and road type — live in production
Deployed on Render with a fully interactive map interface