An interactive Machine Learning dashboard simulating the economic fallout of geopolitical energy shocks on APAC supply chains.
What happens when global energy supply chains break? The GeoImpact Risk Engine is a predictive analytics platform designed to answer that question.
By taking real-world constraints—such as a country's Strategic Petroleum Reserve (SPR) days, Middle East fuel dependency, and alternative sourcing capabilities—this engine runs mathematical simulations to forecast the cascading economic damage of regional conflicts. It serves as an interactive "what-if" tool for policymakers, analysts, and economists.
Live Demo: https://geoimpact.streamlit.app/
- 📊 Dynamic Economic Forecasting: Predicts the exact percentage surge in Inflation and GDP Contraction, alongside absolute Import Cost spikes.
- 🎛️ Interactive Scenario Engine: Tweak shock factors (e.g., Oil Price Premium spikes up to 150%) to stress-test an economy's breaking point.
- 🧠 Machine Learning Core: Powered by ensemble models (
XGBRegressor&XGBClassifier) trained on synthetic geopolitical crisis data. - 🔍 AI Explainability (SHAP): Transparently breaks down why the model made its prediction, showing which supply-chain factors are driving inflation.
- 🌍 Country Vulnerability Clustering: Uses
K-Means Clusteringto group APAC nations by their inherent supply chain fragilities. - 🛡️ Actionable Policy Recommendations: Generates immediate, data-driven legislative actions based on the severity of the predicted risk.
| Category | Technologies Used |
|---|---|
| Frontend Framework | Streamlit |
| Data Processing | Pandas, NumPy |
| Machine Learning | Scikit-Learn (K-Means, Preprocessing), XGBoost (Regression & Classification) |
| Data Visualization | Plotly Express, Plotly Graph Objects, Matplotlib |
| AI Explainability | SHAP (SHapley Additive exPlanations) |
- Data Engineering: Processes the
apac_fuel_import_dependency.csvdataset, parsing categorical variables (Fuel_Type,Conflict_Phase) viaLabelEncoder. - Predictive Regression (XGBoost): Three distinct
XGBRegressormodels forecast continuous economic metrics (Inflation Impact, GDP Impact, Import Cost Increase). - Risk Classification (XGBoost): An
XGBClassifiercategorizes the final situation into 4 discrete threat levels: Low, Medium, High, Critical. - Unsupervised Clustering (K-Means): Groups countries into 3 distinct vulnerability clusters based on their historical dependency and reserve levels using
StandardScalerand distance metrics.
To run this engine locally on your machine, follow these steps:
git clone https://github.com/KhannakPGupta/GeoImpact-Risk-Engine.git
cd GeoImpact-Risk-EngineEnsure you have Python 3.10+ installed, then run:
pip install -r requirements.txtstreamlit run app.pyThe app will automatically open in your browser at http://localhost:8501.
If you wish to re-train the XGBoost and K-Means models from scratch:
python ml_training.pyThis will process the data, calculate new accuracy metrics, and overwrite the .pkl files in the /models directory.
GeoImpact-Risk-Engine/
├── app.py # Main Streamlit dashboard application
├── ml_training.py # Script to train and save ML models
├── apac_fuel_import_dependency.csv # The core dataset
├── requirements.txt # Python package dependencies
├── ensemble.ipynb # Jupyter/Colab notebook for exploratory ML
└── models/ # Directory containing pre-trained models
├── reg_inflation.pkl # XGBoost model for Inflation
├── reg_gdp.pkl # XGBoost model for GDP
├── risk_classifier.pkl # XGBoost model for Risk Level
└── ... # Other encoders and scalers