How pavankumarkema/trafficforecastingindia works
This repository is a traffic-forecasting research system with a Streamlit commute dashboard. Its modeling workflow ingests PEMS-BAY or Bengaluru traffic, sanitizes time series, constructs spatial graphs, trains a benchmark model, adapts it to Bengaluru, and evaluates held-out forecasts. The model combines graph convolution, BiLSTM and temporal attention; separate explainability utilities analyze attention. The dashboard’s advertised commute and visualization features are documented, but the sampled app excerpt does not show how it obtains model predictions. Edges reflect shown calls or README workflow statements; unsampled wiring is omitted.
Main entry points: train_transfer.py Bengaluru fine-tuning · train_base.py Base training · app.py Commute dashboard · data_loader.py Dataset loaders
Components 19
Traffic ingestion
- Dataset loaders
src/data_loader.py - Time-series preparation
src/preprocessor.py
Forecast modeling
- Spatial graph builder
src/graph_constructor.py - Base training
train_base.py - Forecast network
src/models.py - PEMS-BAY checkpoint
models/pems_bay_base.pth - Bengaluru fine-tuning
train_transfer.py - Weight adaptation
src/transfer_learner.py - Bengaluru checkpoint
models/bangalore_transfer_model.pth
Evaluation
- Attention analysis
src/explainability.py - Held-out evaluation
generate_paper_results.py - Forecast metrics
results/paper_metrics.csv
Commute experience
- Commute dashboard
app.py - Route and travel estimates
app.py - Interactive traffic map
app.py - Benchmark comparison
app.py
Other components
- Commuters
- PEMS-BAY data
data/PEMS-BAY.csv - Bengaluru routes
data/bangalore_routes.csv
Connections 24
- PEMS-BAY data → Dataset loaders: loads
README.md - Bengaluru routes → Dataset loaders: loads
README.md - Dataset loaders → Base training: supplies data
train_base.py - Time-series preparation → Base training: prepares sequences
train_base.py - Spatial graph builder → Base training: builds adjacency
train_base.py - Base training → Forecast network: trains
train_base.py - Base training → PEMS-BAY checkpoint: saves weights
train_base.py - Dataset loaders → Bengaluru fine-tuning: supplies data
train_transfer.py - Time-series preparation → Bengaluru fine-tuning: prepares sequences
train_transfer.py - Spatial graph builder → Bengaluru fine-tuning: builds adjacency
train_transfer.py - PEMS-BAY checkpoint → Bengaluru fine-tuning: provides weights
train_transfer.py - Bengaluru fine-tuning → Forecast network: fine-tunes
train_transfer.py - Bengaluru fine-tuning → Bengaluru checkpoint: saves weights
- Weight adaptation → Forecast network: adapts parameters
src/transfer_learner.py - Bengaluru fine-tuning → Weight adaptation: uses adaptation
- Bengaluru checkpoint → Held-out evaluation: provides model
generate_paper_results.py - Time-series preparation → Held-out evaluation: transforms data
generate_paper_results.py - Spatial graph builder → Held-out evaluation: builds adjacency
generate_paper_results.py - Held-out evaluation → Forecast metrics: exports metrics
generate_paper_results.py - Forecast network → Attention analysis: provides attention
- Commuters → Commute dashboard: use
README.md - Commute dashboard → Route and travel estimates: offers routing
README.md - Commute dashboard → Interactive traffic map: renders map
README.md - Commute dashboard → Benchmark comparison: shows comparison
README.md