InFoAnalytics – AI-Powered Fiscal Instability Forecasting Dashboard
Started: 2025-11-29
About this project
InFoAnalytics: AI for Fiscal Instability Prediction
Author: Leon Motaung
Environment: Python, Pandas, NumPy, Scikit-learn, Flask, Plotly (Dash), XGBoost
Project Overview
InFoAnalytics is an AI-powered macroeconomic dashboard built to forecast fiscal instability across African economies using machine learning. The system predicts Budget Deficit/Surplus trajectory and extracts signals for early intervention to protect SDG funding (especially SDG 3 – Health & SDG 4 – Education).
A Gradient Boosting Regressor trained on grouped long-format time-series data achieved R² = 0.8660 using time-series cross-validation — demonstrating high predictive power for economic instability.
Live Project Access
Dashboard: https://infoanalytics-gqrb.onrender.com/
GitHub Repository: github.com/LeonMotaung/infoanalytics-AI-ML
Main Dashboard View
The landing page presents key fiscal indicators, historical trends, and country selection.
Strategic Insights
The dashboard highlights risk zones and fiscal shifts using statistical trends and forecasting models. This allows policy-makers to react ahead of time and deploy fiscal buffers.
Unemployment Trends
Economic indicators such as unemployment, inflation, and government spending are visualized to reveal patterns and correlations across time. These features are also used as ML predictors.
Market Analysis
Market behavior and macroeconomic dependencies are analyzed to isolate key risk drivers and supply-side shocks that influence fiscal stability.
Machine Learning Approach
- Grouped time-series data (by Country) to avoid data leakage
- Lag-based features (1, 3, 6 periods)
- Rolling means to capture local momentum
- First-order differencing → solves stationarity
- Models trained: Gradient Boosting, XGBoost, Random Forest
Core Results
| Metric | Value | Interpretation |
|---|---|---|
| R² | 0.8660 | 86.6% variance explained (strong predictions) |
| RMSE | 53,889.33 | Error magnitude of predictions |
First-order differencing was critical to achieving high accuracy.
Policy Recommendation
Based on ML results, a Fiscal Momentum Buffer (FMB) is proposed:
- Triggers when deficit trajectory worsens
- Protects Health & Education budgets first
- Allows pre-emptive budget allocation
Project Structure
notebook.ipynb– Data processing & model trainingapp.py– Flask dashboard (deployment)feature_engineering.py– Custom pipelinemodels/– Trained GBR model1.png–4.png– Dashboard visuals
Conclusion
This project combines machine learning + economics + policy design to create an early-warning system that helps governments protect funding for SDGs during fiscal instability.