An end-to-end data science project analyzing 23,000+ macroeconomic indicators to diagnose Africa's sovereign debt crisis. Features include an AI-powered 'Early Warning System' for fiscal shocks, predictive modeling of 2030 deficit trends, and the 'FiscalGuard' policy simulation dashboard designed to optimize resource allocation in emerging markets.
# FiscalGuard: Sovereign Debt & Fiscal Resilience Analysis
**Predicting Africa's Fiscal Future using Data Science & Machine Learning**
## Project Overview
**FiscalGuard** is a comprehensive data science project designed to diagnose the root causes of sovereign debt crises in emerging African markets (with a focus on Nigeria, Egypt, and South Africa).
Using a dataset of over **23,700 fiscal records**, this project moves beyond simple visualization to build an **Early Warning System (EWS)** for fiscal instability. It leverages diagnostic analytics to identify structural economic flaws—such as the "Growth Paradox" and "Efficiency Gaps"—and employs predictive modeling to forecast fiscal trajectories through 2030.
### 🎯 Key Objectives
* **Diagnose:** Uncover the mathematical drivers of budget deficits (e.g., the correlation between GDP Growth and Debt).
* **Predict:** Forecast future deficits under "Business as Usual" vs. "Reform" scenarios using Linear Regression.
* **Solve:** Propose a data-backed "Combined Strategy" (The 50/50 Rule) to reclaim fiscal space for the Sustainable Development Goals (SDGs).
---
## Tech Stack & Methodology
This project was built using Python and the following data science libraries:
* **Pandas:** For cleaning, standardizing, and aggregating 23,000+ rows of messy fiscal data (handling mixed currencies and units).
* **Seaborn & Matplotlib:** For exploratory data analysis (EDA) and generating publication-ready visualizations of economic trends.
* **Scikit-Learn:** For building the **Anomaly Detection** model (Z-Score) and **Linear Regression** forecasting models.
* **Numpy:** For high-performance numerical calculations in the simulation engine.
---
## Key Insights & Findings
### 1. The "Jaws of Deficit" (Structural Divergence)
Our analysis revealed a critical decoupling in Nigeria's economy:
* **Expenditure** has grown exponentially while **Revenue** has remained linear.
* This created a structural deficit that widens regardless of oil …