Logo Lanfrica

lekejr/nigeria-road-accident-ml

Domain:

peace and security

Record type:

dataset
Creator:
lek
Host:
Machine learning analysis predicting road accident fatalities in Nigeria from causative-factor data using Random Forest # Predicting Road Accident Fatalities in Nigeria: A Causative-Factor Analysis ## The Question Nigeria's National Bureau of Statistics publishes accident counts and casualty totals by state, alongside a separate breakdown of *why* those accidents happened — 17 recorded causes ranging from speed violation to sleeping at the wheel. These two datasets are rarely analyzed together. This project merges them and asks a direct question: **which of these 17 causes actually drives fatality counts, and how much predictive power do they carry?** The answer matters beyond academic interest. Nigeria's road safety budget and enforcement attention are finite. If one or two causes account for most fatal outcomes, that's where policy and enforcement should concentrate — not spread evenly across 17 categories that don't contribute equally. ## Data Two datasets, both sourced from the National Bureau of Statistics, were combined: | Dataset | What it contains | Rows (raw) | Rows (after cleaning) | |---|---|---|---| | `nigeria_road_accidents.csv` | Accident and casualty counts by state and reporting period — fatal cases, serious cases, minor cases, total casualties, people involved | 222 | 222 | | `nigeria_road_accidents_causes.csv` | Causative-factor counts by state and reporting period — 17 numeric cause columns | 245 | 222 | The causes dataset needed real cleaning before it was usable: 23 rows had no state or period recorded at all, and several of the 17 numeric cause columns were stored as text rather than numbers, which would have silently broken any aggregation or modeling downstream if left unchecked. After standardizing column names, removing incomplete rows, and coercing the cause columns to numeric, both datasets aligned to exactly 222 matched state-period records with zero missing values remaining. That completeness was verified explicitly, not assumed. The two datasets were merged on `state` + `period` (inner join), producing a single modeling dataset of **222 rows × 2 …