XGBoost + SHAP model explaining COVID-19 mortality variation across 23 African countries ; hospital capacity beats comorbidity burden as the top predictor.
# COVID-19 Mortality Risk Scoring in Africa: XGBoost & SHAP Explainability
Why did reported COVID-19 mortality range from **1 death/million in Burundi** to **350+ deaths/million in Zimbabwe**? This project uses an explainable machine learning approach to find out — and the answer isn't what you'd expect.
## Overview
This project applies **XGBoost regression** and **SHAP (SHapley Additive exPlanations)** to identify the structural drivers of COVID-19 mortality variation across 23 African countries, using country-level surveillance data from Our World in Data (2020–2024).
Rather than direct comorbidity burden (diabetes, cardiovascular disease, age), **healthcare infrastructure capacity and development indices** emerge as the dominant predictors — a finding consistent with systematic under-reporting of COVID-19 deaths in lower-resource settings.
The project includes a detailed **Kenya case study** and a **Low / Medium / High risk stratification framework** intended to support pandemic preparedness prioritization.
## Key Findings
- **Hospital beds per thousand** was the single dominant predictor of mortality (mean \|SHAP\| = 0.63) — over 3x more important than any other feature.
- **Median age** and **% of population 65+**, despite strong raw correlation with mortality (r = 0.76–0.77), had near-zero SHAP importance once healthcare capacity and development indices were accounted for.
- The model achieved a **Leave-One-Out CV MAE of 52.3 deaths/million** and **R² = 0.325** on the log-transformed scale.
- **Kenya** was classified as *Medium risk*, with the model predicting 109.6 deaths/million against an actual 104.9 — one of the most accurate individual predictions in the dataset.
- Eight countries were flagged **High risk** for pandemic preparedness prioritization: Sao Tome and Principe, Zimbabwe, Zambia, Egypt, Comoros, Algeria, Gambia, and Malawi.
**Interpretation:** the model likely reflects *reporting capacity* rather than true biological mortality risk — cou …