Machine learning project for predicting life expectancy in African countries using socioeconomic and health indicators.
# Predicting Life Expectancy in African Countries Using Public Health Indicators
## Project overview
This project predicts **life expectancy in African countries** using selected public health indicators from the World Bank Indicators API. The project follows a data science workflow: problem definition, data collection, data cleaning, exploratory analysis, mathematical explanation, model training, evaluation, visualization, and interpretation.
## Research question
**How well can life expectancy in African countries be predicted using public health indicators?**
## Objectives
1. Collect public health indicator data for African countries from the World Bank API.
2. Clean and merge the downloaded indicator datasets.
3. Explore relationships between life expectancy and health-related predictors.
4. Build an interpretable machine learning regression model.
5. Evaluate the model using MAE, RMSE, and R².
6. Interpret the results and discuss limitations.
## Dataset
The dataset is downloaded directly in the notebook from the **World Bank Indicators API**.
Main data source: World Bank Open Data / World Bank Indicators API
Dataset link: World Bank Open Data
The notebook uses the following indicators:
| Variable | World Bank indicator code | Meaning |
|---|---:|---|
| `life_expectancy` | `SP.DYN.LE00.IN` | Life expectancy at birth, total years |
| `health_expenditure_pct_gdp` | `SH.XPD.CHEX.GD.ZS` | Current health expenditure as percentage of GDP |
| `dpt_immunization` | `SH.IMM.IDPT` | DPT immunization coverage percentage |
| `hiv_prevalence` | `SH.DYN.AIDS.ZS` | HIV prevalence percentage |
| `infant_mortality` | `SP.DYN.IMRT.IN` | Infant mortality rate |
Because the data is downloaded through the API, the raw dataset does not need to be uploaded manually. When the notebook runs successfully, it saves cleaned and prediction output CSV files.
## Repository structure
```text
life_expectancy_africa_project/
│
├── notebooks/
│ └── Predicting_Life_Expectancy_ …