Machine learning nowcasts of Nigeria's unemployment rate during the NBS data blackout
# Nowcasting Nigeria's Unemployment Rate Using Machine Learning on Alternative Data Sources
Code and data for the paper "Nowcasting Nigeria's Unemployment Rate Using Machine Learning on Alternative Data Sources" by Ugwu, Akor Peter (Department of Computer Science, Benson Idahosa University, Benin City, Nigeria).
## The problem
Unemployment is Nigeria's leading economic risk for 2026, yet the National Bureau of Statistics (NBS) has not published labour force statistics since Q2 2024. This project estimates the unemployment rate for the unpublished quarters using machine learning trained on indicators that are still being published: inflation, GDP growth, the Purchasing Managers' Index, the official exchange rate, and the Brent crude oil price.
## Key results
- Best model: Gradient Boosting. Leave-one-out R² of 0.671 overall. RMSE of 0.75 percentage points within the current survey methodology regime.
- Nowcasts for the data blackout (Q3 2024 to Q2 2026): unemployment between 4.3 and 4.7 percent, with an interval of ±0.75 percentage points.
- Strongest predictors: exchange rate (importance 0.32) and PMI (0.21). Both publish monthly, so the nowcast can update monthly.
- The 2023 structural break in the NBS series (methodology change from 33.3 percent under the old definition to 4.1 percent under the new NLFS) is handled by within-regime standardisation of the target.
## Files
| File | Description |
|---|---|
| `nowcast.py` | Full pipeline: loads the dataset, applies the regime correction, trains four models, runs leave-one-out cross-validation, generates the nowcasts and all five figures |
| `nowcast_dataset.csv` | Quarterly dataset, 2015Q1 to 2026Q2 (46 quarters). Published NBS unemployment figures plus the five predictors. Missing unemployment values mark unpublished quarters |
| `nowcast_results.csv` | Leave-one-out RMSE, MAE, and R² for all four models |
| `nowcasts.csv` | Model estimates for the eight unpublished quarters with uncertainty intervals |
## Ho …