ML credit scoring pipeline - Bank of Africa internship. LR, Decision Tree, Random Forest, XGBoost + IFRS 9 ECL + SHAP explainability
# ML-Augmented Personal Credit Scoring Model — Bank of Africa
**Internship project** | Risk Management Department — Bank of Africa
**Author:** Walid KILANI
---
## Project Overview
This project builds an **end-to-end ML credit scoring pipeline** for personal/retail borrowers, inspired by an internal BOA/Talaty scoring system originally developed for TPE (small business) clients.
The goal is to prototype the full pipeline on public data (Give Me Some Credit — Kaggle), ready to swap in real BOA data when it becomes available.
---
## Pipeline Architecture
```
Raw Data (CSV)
↓
Data Cleaning & EDA
↓
Feature Engineering
↓
Model Training (LR → DT → RF → XGBoost)
↓
Evaluation (AUC / GINI / KS / Recall / F1)
↓
PD Calibration & Risk Bucketing (10 buckets)
↓
IFRS 9 ECL Calculation (Stage 1/2/3)
↓
SHAP Explainability
↓
Business Case Simulation
↓
CSV Exports → Power BI Dashboard
```
---
## Model Results (Give Me Some Credit — 150,000 borrowers)
| Model | AUC | GINI | KS | Recall | F1 |
|---|---|---|---|---|---|
| Logistic Regression | 0.8588 | 0.7176 | 0.5661 | 0.7752 | 0.3267 |
| Decision Tree | 0.8553 | 0.7105 | 0.5613 | 0.7652 | 0.3320 |
| **Random Forest** ✅ | **0.8634** | **0.7268** | **0.578** | **0.7502** | **0.3583** |
| XGBoost | 0.8632 | 0.7263 | 0.5776 | 0.7647 | 0.3427 |
> **Recommended model: Random Forest** — best AUC (0.8634) and GINI (0.7268), exceeding the TPE project benchmark (GINI = 0.66).
---
## Risk Bucket Table (10 deciles)
| Bucket | Pop % | Cum % | Default % | Delegation |
|---|---|---|---|---|
| B01 | 10% | 10% | 0.11% | ✅ AUTO APPROVE |
| B02 | 10% | 20% | 0.22% | ✅ AUTO APPROVE |
| B03 | 10% | 30% | 0.48% | ✅ AUTO APPROVE |
| B04 | 10% | 40% | 0.72% | ✅ AUTO APPROVE |
| B05 | 10% | 50% | 1.39% | ✅ AUTO APPROVE |
| B06 | 10% | 60% | 2.42% | ✅ AUTO APPROVE |
| B07 | 10% | 70% | 3.67% | ✅ AUTO APPROVE |
| B08 | 10% | 80% | 6.54% | ⚠️ MANUAL REVIEW |
| B09 | 10% | 90% | 12.32% | ⚠️ MANUAL REVIEW |
| B10 | 10% | 100% | 39.12% | ❌ DECLINE / EX …