# 🏥 Africa Health Investment Returns
**A machine learning pipeline that quantifies the measurable health returns on public investment across 53 African countries — pulling 23 years of World Bank data, training XGBoost models on three health outcomes, and surfacing a Policy Simulator where you adjust Kenya's health-spending sliders and get SHAP-grounded predictions in real time.**
| Metric | Value |
|---|---|
| Countries | 53 African countries |
| Time span | 2000 – 2022 (23 years) |
| Dataset rows | 1,219 |
| Feature variables | 8 |
| Target variables | 3 |
| Best model R² | 0.945 (Maternal Mortality) |
| Pipeline cost | $0 |
| App lines of code | 713 (app.py) |
| Live dashboard |
africa-health-ml.streamlit.… |
---
## 🎯 Project Goal
African policymakers and health economists routinely debate whether increasing health spending as a share of GDP actually moves the needle on mortality and life expectancy — or whether the gains are overwhelmed by income levels, sanitation, and education. This project answers that question empirically by training separate XGBoost regressors for Life Expectancy, Under-5 Mortality, and Maternal Mortality, then using SHAP to decompose exactly how much each spending and infrastructure variable contributes to each prediction. The final deliverable is a Policy Simulator: set Kenya's health spending, education spending, water access, and other parameters, and get an immediate, model-backed forecast of expected health outcomes.
---
## 🧬 System Architecture
```
World Bank REST API v2
│
▼
data_pipeline.py # Fetch → clean → impute → store
│
▼
data/processed/
health.parquet # 1,219 rows, 8 features + 3 targets
│
▼
XGBoost training (in-app) # One model per target variable
│
├── data/models/model_SP_DYN_LE00_IN.json # Life Expectancy
├── data/models/model_SH_DYN_MORT.json # Under-5 Mortality
└── data/models/model_SH_STA_MMRT.json # Maternal Mortality
│
▼
SHAP explainer # Per-feature contr …