Machine learning pipeline predicting economic recessions in 27 African countries (2000-2017) using Penn World Table & Bank of Canada data. XGBoost, SMOTE, VIF-based multicollinearity resolution, SHAP interpretation. iiAfrica Capstone Project.
# Analyzing and Predicting Economic Recessions in African Countries (2000–2017)
A Machine Learning and Data Evaluation study built as part of the Industry Immersion Program (iiAfrica) Capstone Project.
**Team (Group 2):** Michaud Carlos Kouétsa, Iyetomola Rachael Ojo,Sandah Adiza, Djibril Ndour, Nelly Vanessa Noudem Medongou, Icon Abebe Gido
## Overview
This project investigates the macroeconomic determinants of economic recessions across 27 African countries between 2000 and 2017, using a panel of 486 country-year observations and 49 predictors from the Penn World Table and Bank of Canada commodity price indices. The target variable, `growthbucket`, is heavily imbalanced (7.82% recessions).
We built a full 7-step machine learning pipeline, diagnosed and resolved severe multicollinearity among predictors, handled class imbalance with SMOTE, trained and compared eight classifiers, and interpreted the final model with SHAP.
## Key Results
| Model | Precision | Recall | F1-score | ROC-AUC |
|---|---|---|---|---|
| **XGBoost (final model)** | 0.714 | 0.625 | **0.667** | 0.862 |
| AdaBoost | 0.500 | 0.500 | 0.500 | 0.883 |
| Logistic Regression | 0.286 | 0.750 | 0.414 | 0.792 |
| Random Forest | 0.400 | 0.250 | 0.308 | 0.839 |
**XGBoost** was selected as the final model, correctly identifying 5 of 8 real recessions in the test set (62.5% recall) while raising only 2 false alarms.
## Pipeline
| Step | Notebook | Description |
|---|---|---|
| 1 | `Step1_Data_Preparation.ipynb` | Data loading, quality checks, stratified train/test split, standardization |
| 2 | `Step2_EDA.ipynb` | Exploratory data analysis, target distribution, correlations |
| 2b | `Step2b_Multicollinearity.ipynb` | VIF diagnostics and iterative feature elimination (49 → 31 features) |
| 3 | `Step3_Class_Imbalance.ipynb` | SMOTE, undersampling, and class weighting compared |
| 4 | `Step4_Model_Training.ipynb` | Training of 6 classifiers (Logistic Regression, Random Forest, XGBoost, SVM + weighte …