Machine learning · end-to-endPredicting bus delays in Luxembourg
Flags ~83% of real delays as a simple daily risk list.
problem
Operations teams usually learn about bus delays only after they have spread across the network. There was no early signal for which trips were likely to run late.
what i did
I collected about 7.4 million stop events myself through a public-transport API, over roughly eight weeks in the summer of 2025, then built one clean, reproducible dataset (SQL to CSV) for both the analysis and the model. I ran EDA across hour, weekday, route, stop, and operator, and engineered 13 leakage-safe features that use only what is known before the bus arrives. I compared a logistic-regression baseline against tree models, scored on F1 (delays are only about 36% of events, so accuracy would mislead), and tuned the alert threshold to a real operations trade-off.
result
A Random Forest risk score that catches about 83% of real delays at the chosen threshold (around 0.46), packaged as a green, yellow, and red alert list with a rollout that runs from shadow to pilot to scale. It also comes with a clear account of where it can't be trusted yet: no real-time traffic or GPS signals, and only about eight weeks of data.
- Python
- pandas
- scikit-learn
- SQL
Data-science program final project · Dec 2025 · data self-collected via API


