End-to-End ML Pipeline & Policy Intervention Simulator for Financial Inclusion in East Africa. Features Stacking Ensembles, Optuna Tuning, and SHAP-driven Explainable AI to map socio-economic barriers to SDG-aligned solutions.
# 🌍 Financial Inclusion in Africa — ML Pipeline & Policy Simulator
Kelvin Byabato ·
---
> **86% of East Africans have no bank account.** This pipeline predicts who is excluded, explains why using SHAP, and recommends SDG-aligned interventions — not just a leaderboard score.
---
## 📋 Table of Contents
- Problem Statement
- Results
- Architecture
- Feature Engineering
- Training Strategy
- Explainability Layer
- Innovation: Policy Simulator
- Setup & Reproduction
- File Reference
- References
---
## 🎯 Problem Statement
**Competition:** Zindi Africa — Financial Inclusion in Africa
**Task:** Binary classification — predict bank account ownership (Yes=1, No=0)
**Metric:** Mean Absolute Error (MAE) on hard 0/1 predictions
**Data:** ~33,600 survey respondents, Kenya · Rwanda · Tanzania · Uganda · 2016–2018
**Class imbalance:** 14% positive (banked) · 86% negative (unbanked) · 6:1 ratio
**Why MAE matters here:** MAE on binary labels equals the fraction of misclassified predictions. Minimizing MAE = maximizing accuracy. With class imbalance, the optimal threshold is NOT 0.5 — threshold optimization is critical.
---
## 🏆 Results
| Model | OOF MAE | OOF AUC | Notes |
|---|---|---|---|
| Logistic Regression | ~0.170 | ~0.750 | Baseline |
| XGBoost (default) | ~0.130 | ~0.840 | +24% vs baseline |
| LightGBM (default) | ~0.130 | ~0.840 | Speed advantage |
| CatBoost (default) | ~0.130 | ~0.840 | Native categoricals |
| XGBoost (Optuna-tuned) | ~0.120 | ~0.855 | 50-trial Bayesian search |
| **Stacking Ensemble** | **0.1117** | **0.8647** | **Final submission** |
All scores are **Out-of-Fold** — evaluated only on held-out data, never on training samples.
---
## 🏗️ Architecture
```
financial-inclusion-africa-ml-zindi/
│
├── src/ ← Library (import, don't modify directly)
│ ├── __init__.py
│ ├── config.py — Paths, params, encoding maps (change here only)
│ ├── features.p …