CrashMap

How CrashMap ranks road risk

A road’s risk on CrashMap is its expected number of death-or-serious-injury (DSI) crashes per kilometre per year. How often crashes happen comes from the crash record; how severe they are likely to be comes from a machine-learning model.

The idea in one paragraph

The models predict the probability that a crash is fatal or serious given that it happened. Rather than counting only the crashes that turned out to be serious, CrashMap adds up those probabilities over every crash recorded on a road. A stretch with many crashes that each had a high chance of being serious ranks above one with a single unlucky serious crash, which makes the ranking steadier from year to year.

Step by step

  1. Roads. Roads come from the Geofabrik New Zealand OpenStreetMap extract. Ways are merged by road name and cut into lengths of at most 1 km: 39,330 road lengths, about 26,500 km in total.
  2. Crashes to roads. Each crash is snapped to the nearest road length within 30 m, preferring one whose name matches the road name in the crash record. About 99 per cent of crashes snap; about 0.7 per cent are not within 30 m of a mapped road and are left out.
  3. Expected DSI. A road length’s expected DSI is the sum of its crashes’ predicted probabilities, divided by its length (at least 0.5 km is used, so very short stretches are not inflated) and by the number of years selected.
  4. Ranking and bands. Road lengths with at least a minimum number of crashes (two by default) are ranked by expected DSI per km per year and banded by their share of the ranked road length.
Risk bands
BandShare of ranked road length
Hightop 2 per cent
Medium-high2–5 per cent
Medium5–15 per cent
Low-medium15–40 per cent
Lowthe rest

Bands are relative, so they move with the filters: under “Heavy rain + Dark”, High means the top 2 per cent of roads for wet-night crashes. The legend on the map shows the value at which each band starts.

The models

There are 86 model configurations from five model families (XGBoost, LightGBM, CatBoost, random forest and logistic regression), combined with different ways of handling the imbalance between serious and minor crashes (none, class weighting, SMOTENC resampling and scaled class-weight ratios) and different tuning set-ups.

The map uses the leading configuration of a rolling-origin backtest by default: each of 2022, 2023, 2024 and 2025 is scored by a model trained only on earlier years, so no year is scored by a model that has seen it. The leader is XGBoost without class balancing, with a mean validation PR-AUC of 0.3060 over 2022–2024. It is first among several ensembles that are statistically indistinguishable, so the map also offers the five leading ensembles averaged.

Every stored set of predictions must reproduce the metrics its experiment published (PR-AUC, ROC-AUC, precision and recall to within 0.00005) before the map will use it.

Checking the models

The model diagnostics view shows how a configuration classified each crash in a scored year: serious crashes found, serious crashes missed and false alarms. You can change the decision threshold, weight a missed serious crash against a false alarm, and read recall, precision (as lift over the base rate), PR-AUC and ROC-AUC.

Limits

  • Risk per km, not per vehicle. There are no traffic volumes, so busy roads rank high partly because they are busy.
  • Recorded crashes only. The ranking depends on crashes being reported to Police and recorded in CAS. Recording of minor and non-injury crashes has fallen since 2019, which changes the mix the models see.
  • Severity given a crash. The models estimate how likely a crash is to be serious once it has happened, not how likely a crash is to happen.
  • Unsnapped crashes. About 0.7 per cent of crashes are not within 30 m of a mapped road and are left out of the road ranking.
  • Close models. The five leading ensembles are statistically indistinguishable across 2022–2024; differences between them are mostly noise.

Citing a view

Link to the exact view (the address carries the whole selection), name the model configuration and years, and note that ranks are expected DSI crashes per km per year from recorded crashes, without traffic volumes.

Open the map