DEV Community

Cover image for 95% R Without Neural Networks: Solving the Flipkart GridLock 2.0 Traffic Challenge
SNiPERxDD
SNiPERxDD

Posted on • Originally published at github.com

95% R Without Neural Networks: Solving the Flipkart GridLock 2.0 Traffic Challenge

Traffic demand forecasting is often treated as a "deep learning first" problem. However, for the Flipkart GridLock 2.0 Hackathon, I took a different approach: a hierarchical basis-day routing matrix combined with ridge calibration.

The result? A 95.007% R² score that is both computationally efficient and fully interpretable.

The Challenge

The competition (organized by Flipkart and the Bengaluru Traffic Police) required predicting demand on a specific hidden horizon (Day 49). The data included spatial geohashes, temporal timestamps, and road-level metadata.

The Architecture

Instead of a black-box neural network, the pipeline uses four logical stages:

  1. Proxy Construction: Using non-overlapping Day 49 labels to learn spatial structures.
  2. Hierarchical Routing: Fitting simplex-constrained weights across global, geo_4, and geo_5 granularities.
  3. Ridge Calibration: A linear model trained on the observed early-morning Day 49 slice to adjust for real-time trend shifts.
  4. Residual Correction: A bounded additive geohash-level fix based on historical weekly patterns.

Why This Matters

By avoiding deep learning, the model runs in seconds on standard hardware and provides clear insights into why a specific demand prediction was made—crucial for urban mobility decision support.

I've open-sourced the full pipeline, including the optimized .xz data handling and EDA companion notebooks.

View the full project on GitHub: https://github.com/SNiPERxDD/GridLock2.0

GitHub logo SNiPERxDD / GridLock2.0

Flipkart Gridlock 2.0 hackathon Phase - 1 Solutions

GridLock 2.0 Forecasting Pipeline

Python Score Pipeline

GridLock 2.0 is a traffic intelligence hackathon organized by Flipkart in partnership with Bengaluru Traffic Police and hosted on HackerEarth. Phase 1 is an online machine learning challenge with a live leaderboard, where participants submit models against the provided task and improve them over multiple submissions. The official competition page is GridLock 2.0 on HackerEarth.

This repository packages the Phase 1 forecasting pipeline used for the Day 49 demand prediction task, together with a script, companion notebooks, model artifact, and local evaluation files.

Quick start

pip install -r requirements.txt
python gridlock_release_pipeline.py
Enter fullscreen mode Exit fullscreen mode

The final predictor is not a neural network. It combines:

  • a hierarchical basis-day routing matrix,
  • a ridge regression calibrator,
  • and a bounded geohash residual correction.

Repository layout

GridLock 2.0/
├── README.md
├── requirements.txt
├── gridlock_release_pipeline.py
├── notebooks/
│   ├── gridlock_release_pipeline.ipynb
│   └── gridlock_eda_companion.ipynb
├── data/
│   ├── competition_train.csv
│   ├── competition_test.csv
│   ├── evaluation_ground_truth.csv

Tags: #bengaluru #urbanmobility #flipkart #gridlock

Top comments (0)