Writing
Predicting Road Accident Severity Across the City of London
Coursework for LSBU's Data Mining & Big Data Analytics module, but with a real question behind it: can two years of collision data tell you where and when the fatal accidents happen, so resources can go there first?
I worked with 1,983 City of London road accidents from 2022–2023, aiming to predict severity and surface the conditions that drive the worst outcomes — the kind of analysis that feeds into emergency resource allocation and council safety planning.
The hard part: imbalance
The target was badly skewed — 85.9% slight, 13.7% serious, 0.5% fatal.
| Severity | Share of accidents |
|---|---|
| Slight | 85.9% |
| Serious | 13.7% |
| Fatal | 0.5% |
A model that predicts "slight" every time scores 86% accuracy and is useless. So accuracy was never the metric that mattered; recall on the rare, serious classes was.
I cleaned the data with z-score outlier removal and mode imputation, then used SMOTE to rebalance the training set before fitting a Decision Tree classifier for severity prediction. It reached 75.2% accuracy and, more importantly, 92% recall on fatal accidents — it caught almost all of the cases that matter.
Finding the patterns
Prediction tells you what; I wanted why. Mining Apriori association rules over the accident conditions surfaced concrete risk patterns — the strongest being wet dual carriageways after dark, which reached a 73% fatal-confidence rule with 58× lift over the base rate.
| Result | Value |
|---|---|
| Model | Decision Tree, trained on SMOTE-rebalanced data |
| Overall accuracy | 75.2% |
| Recall on fatal accidents | 92% |
| Strongest Apriori rule | Wet dual carriageway after dark |
| Rule confidence (fatal) | 73% |
| Lift over base rate | 58× |
Across the board, road type, surface condition and lighting were the strongest predictors of a fatal outcome.
What I took from it
The metric is the model. Choosing recall-on-fatal over accuracy, and rebalancing the data to make that possible, changed what the project was actually optimising for — and turned it into something you could hand to someone making safety decisions.
Full code on GitHub.
← All writing