How aditya-singh2005/flipkart-gridlock-2.0-bengaluru-traffic-ai-prediction works
Purpose and execution model
This is a notebook-driven machine-learning solution for the Flipkart Gridlock Hackathon 2.0: predict Bengaluru traffic demand from tabular traffic, weather, road, vehicle, and landmark data. There is no deployed service or package entry point; the operational entry points are Jupyter/Colab notebooks:
• model/notebook.ipynb
• model/demo.ipynb
Input and output contract
Training and inference consume competition CSV datasets:
• Data/train.csv
• Data/test.csv
The pipeline produces competition-format predictions, represented by:
• output/sample_submission.csv
The README notes official data restrictions, so the committed CSVs should be treated as the repository’s local data boundary rather than a guaranteed complete production dataset.
Data preparation and feature stage
Notebook execution loads train/test data, treats missing values, encodes categorical fields, and derives model features, especially temporal features. The resulting feature matrix is the shared boundary between preprocessing and model training/inference. The stated model uses 13 features.
• model/notebook.ipynb
• Data/train.csv
• Data/test.csv
Validation and generalization boundary
Model selection is based on 5-fold GroupKFold cross-validation rather than random splitting. Group-aware folds isolate related observations between train and validation partitions, making out-of-fold (OOF) predictions and R² the central reliability checks. The reported validated OOF R² is 0.91624.
• model/notebook.ipynb
• model/demo.ipynb
Model training stage
The estimator is a LightGBM regressor. Each fold trains with early stopping against its held-out group-aware validation subset; optimal boosting iterations are selected per fold. Fold models generate validation predictions for OOF scoring and test predictions for final aggregation.
• model/notebook.ipynb
• requirements.txt
Prediction and submission stage
After cross-validation, the workflow applies the trained fold models to the transformed test set, combines predictions, and writes a submission CSV matching the competition schema. output/sample_submission.csv is the artifact/schema reference, not a standalone inference application.
• output/sample_submission.csv
• model/notebook.ipynb
Runtime and external dependencies
Execution requires Python in Jupyter Notebook or Google Colab, with NumPy, Pandas, scikit-learn, and LightGBM. External entities are data providers/competition stakeholders—Flipkart, Bengaluru Traffic Police (ASTraM), and MapMyIndia—not runtime APIs. The linked Colab notebook is an alternative hosted runtime.
• requirements.txt
• README.md
Architectural constraints
The repository is experimentation-centric: transformation logic, validation, training, evaluation, and export are coupled inside notebooks rather than reusable modules. Reproducibility depends on notebook cell order, local CSV availability, and installed library versions; no model artifact registry, scheduled pipeline, real-time API, or serving infrastructure is present.
• model/notebook.ipynb
• model/demo.ipynb
Main entry points: notebook.ipynb Fold models · requirements.txt Python ML dependencies · demo.ipynb Demo notebook · README.md Repository guidance
Components 15
Notebook runtime
- Training notebook · Couples preparation, validation, training, and export.
model/notebook.ipynb - Demo notebook · Alternative interactive workflow.
model/demo.ipynb - Python ML dependencies · NumPy, Pandas, scikit-learn, and LightGBM.
requirements.txt - Repository guidance · Documents data restrictions and notebook-based execution.
README.md
Local competition data
- Training CSV
Data/train.csv - Test CSV
Data/test.csv
ML workflow
- Feature preparation · Handles missing values, categorical encoding, and temporal features.
model/notebook.ipynb - 13-feature matrices · Shared transformed train and test features.
model/notebook.ipynb - 5-fold GroupKFold · Keeps related observations out of matching train and validation folds.
model/notebook.ipynb - LightGBM fold training · Uses held-out folds for early stopping and per-fold iteration selection.
model/notebook.ipynb - Fold models · Generate validation and test predictions.
model/notebook.ipynb
Evaluation and output
- OOF predictions
model/notebook.ipynb - OOF R²: 0.91624
model/notebook.ipynb - Aggregated test predictions · Combines predictions across fold models.
model/notebook.ipynb - Submission CSV · Schema reference and competition-format prediction artifact.
output/sample_submission.csv
Connections 15
- Python ML dependencies → Training notebook: supports execution
- Python ML dependencies → Demo notebook: supports execution
- Repository guidance → Training notebook: documents usage
- Training CSV → Feature preparation: loads
- Test CSV → Feature preparation: loads
- Feature preparation → 13-feature matrices: transforms into
- 13-feature matrices → 5-fold GroupKFold: splits training features
- 5-fold GroupKFold → LightGBM fold training: provides fold partitions
- LightGBM fold training → Fold models: trains
- Fold models → OOF predictions: predicts held-out folds
- OOF predictions → OOF R²: 0.91624: evaluates
- 13-feature matrices → Fold models: supplies transformed test features
- Fold models → Aggregated test predictions: predicts test set
- Aggregated test predictions → Submission CSV: writes
- Demo notebook → 5-fold GroupKFold: uses validation approach