Incident Forecasting Pipeline
Predicting where incidents happen next, across 129 sites
A transportation company needed to know how many operational incidents each of its locations would see in the coming year, so it could move from reacting toward preventing. I built the pipeline that produces those forecasts.
The best thing in it is a feature I deleted. Several same-year features correlated above 99%a with the target. Left in, the model would have scored beautifully and forecast nothing. Catching your own leakage is worth more than any accuracy figure, because the alternative is a number that flatters everyone until it is used.
The current model reaches R² 0.8684b across 129a locations and 20,000+ records, with a mean absolute error of 21.32 and 66% less error than a naive mean baseline. I engineered 56 candidate features and kept 20, ranked by importance averaged across two ensembles rather than trusted from one. The target is log-transformed, because incident counts are right-skewed. The split is strictly temporal, with no random cross-validation. That scores worse, and it is the only correct choice for time-ordered data.
Interaction features moved R² from roughly 0.78 to 0.87. Feature engineering mattered more than model complexity.
Sources
- the public repo, checked 2026-08-28
- the public repo and the internal deliverable log, which agree, checked 2026-08-28
What this does not do
- An older and higher R² still circulates in documents written before the dataset grew. It was real at the time, on 116 locations. The distribution changed with the data, and 0.8684 is the current figure.
- The extension into driver risk scoring is in progress and has not shipped.