Traffic Volume Forecasting for a High-Density Urban Corridor
A hybrid Random Forest–LSTM model forecasts hourly traffic volume using time-of-day, day-of-week, historical volume, and weather. This dashboard trains and runs the real models in your browser via TensorFlow.js — nothing here is faked.
Average Hourly Traffic Volume
Weekday vs. weekend pattern, averaged across the full dataset.
Traffic Volume by Weather Condition
Mean hourly volume grouped by prevailing weather.
Data Collection Summary
Upload Your Own Traffic Data & Train
This is the part that actually answers your research question: upload the traffic counts you collect yourself (e.g. manual counting at one intersection) and train real Random Forest, LSTM, and Hybrid models on it — entirely in this browser tab, no server needed.
1. Collect your data
Count vehicles passing your chosen point for a set interval (usually 1 hour) and log it, ideally across different times of day and several days (weekday + weekend) so the model sees varied patterns.
⚠️ Avoid pasting dates straight from Excel without checking the format — Excel sometimes exports a date as a plain number (e.g. "46238") instead of text. Format the date column as text first, or use YYYY-MM-DD.
Download CSV template2. Upload your CSV
Forecast Explorer Benchmark demo — Minnesota, USA dataset
Pick any window inside the held-out test period (data none of the models trained on) and run live inference with the Random Forest, LSTM, and RF–LSTM Hybrid models. This uses the large public benchmark dataset to prove the modeling pipeline works — see Upload & Train to run it on your own collected data.
Predicted vs. Actual Traffic Volume
Model Comparison — Full Test Set Benchmark demo — Minnesota, USA dataset
MAE, RMSE, and R² computed on the entire held-out test period (…), one-step-ahead per hour.
Error Metrics by Model
Full Test-Set Series: Actual vs. Predicted
All ~4 months of held-out data. Zoom by dragging in the mini-range below (or just scroll/inspect).
Predicted vs. Actual (fit quality)
About ROADCAST
Purpose
This study develops and evaluates a hybrid Random Forest–LSTM model for predicting traffic volume in high-density urban road networks, to determine how accurately future traffic conditions can be forecast from historical data — supporting better traffic management and congestion reduction.
Variables
- Independent: time of day, day of week, historical traffic volume, weather (temperature, rain, snow, cloud cover, condition), and the Random Forest / LSTM model outputs themselves (for the hybrid).
- Dependent: Mean Absolute Error (MAE), Root Mean Square Error (RMSE), R² score.
How each model works
- Random Forest — an ensemble of decision trees, each trained on a bootstrapped sample and a random subset of features. Given the current time/weather plus recent lag values (1h, 24h, 168h ago, and a 24h rolling mean), it averages every tree's vote into one prediction. Implemented from scratch in vanilla JS (
scripts/rf.js) — no external ML library. - LSTM — a recurrent neural network (TensorFlow.js) that reads the previous 24 hours of time/weather/volume as a sequence and learns temporal patterns (rush hours, weekly rhythm) to predict the next hour.
- RF–LSTM Hybrid — a stacked ensemble: a small linear meta-model learns the optimal weighted combination of the RF and LSTM predictions (fit on training-set predictions only, then evaluated on the untouched test set).
Data source
Hourly westbound I-94 traffic volume between Minneapolis and St. Paul, MN, USA, with hourly weather and US holiday indicators — the public UCI Metro Interstate Traffic Volume dataset (Hogue, 2019). Duplicate timestamps were removed, sensor-error rows dropped, and only 2016–2018 was used to avoid a large 2014–2015 data gap. Data was split chronologically: training on data before June 2018, testing on the final ~4 months — the models never see test-period outcomes during training.
Limitations
- Single road segment — findings may not generalize to other corridors.
- The Live Forecast tab uses the actual recorded future weather for each hour (a real deployment would need a weather forecast instead of ground truth).
- Forecasts are one-step-ahead (each hour uses real history up to that hour), matching the study's stated evaluation method rather than multi-hour autoregressive rollout.