Gridlock traffic-demand model
Predicts normalised traffic demand (0–1) for a road segment (geohash-6) in a 15-minute slot from road context and weather. Built for the Flipkart GRiD Gridlock hackathon (Bengaluru traffic) by Team Curlyhairbaddie (Kriti Kumari, IIT Roorkee).
Files
| File | What it is |
|---|---|
catboost_fold1.cbm … catboost_fold5.cbm |
five CatBoost regressors (5-fold CV, seed 42) |
preprocess.json |
temperature-imputation medians and the 1,249 known geohashes |
metrics.json |
cross-validation results and the feature list |
Performance
5-fold cross-validation on 77,299 segment-slots: R² 0.9431, MAE 0.0218 (per-fold R² 0.940–0.944). These are the exact models behind the submitted predictions.
Usage
# pip install catboost==1.2.10 pandas geohash2 huggingface_hub
# git clone https://github.com/kriti1730-30/flipkart-gridlock-traffic-demand && cd flipkart-gridlock-traffic-demand
import sys; sys.path.insert(0, "src")
from gridlock import TrafficDemandModel
model = TrafficDemandModel.from_hub("kritik2430/gridlock-traffic-demand")
model.predict_one(geohash="qp02z9", timestamp="8:30", number_of_lanes=4,
large_vehicles="Allowed", landmarks="Yes", road_type="Highway",
temperature=24.5, weather="Sunny")
Inputs: geohash, timestamp (H:M), NumberofLanes, LargeVehicles (Allowed/Not Allowed),
Landmarks (Yes/No); optional day, RoadType (Residential/Street/Highway), Temperature,
Weather (Sunny/Cloudy/Rainy/Snowy). The model averages the five folds and clips to [0, 1].
Features
Hour, minute and 15-minute slot (raw and sine/cosine), decoded geohash coordinates, geohash prefixes (4 and 5 characters), road type, lanes, large-vehicle access, landmarks, temperature and weather. Categorical columns use CatBoost's ordered target statistics.
Limitations
- Trained on two days of challenge data; demand is relative (normalised), not vehicle counts.
- The geohashes in the challenge data are anonymised; geohashes not seen in training get extrapolated location effects.