InfraRisk Lab — Infrastructure Project Finance Risk Platform for Africa & Middle East. Features SC-PD credit model, stress testing, Monte Carlo simulation, debt structuring, and interactive dashboard. Built with Python, Streamlit, and ML models.
# 🏗️ InfraRisk Lab
**Infrastructure Project Finance Risk Platform — Africa & Middle East**
> A dual-domain AI system combining supply chain analytics with infrastructure project finance, modelling credit risk, debt structuring, and stress testing for DFI-backed projects.
---
## 📋 Overview
InfraRisk Lab is a comprehensive platform for **infrastructure project finance risk analysis**, covering 8 flagship projects across Nigeria, Kenya, Morocco, Ethiopia, Saudi Arabia, Ghana, Egypt, and the UAE.
### Key Capabilities
| Module | Description |
|--------|-------------|
| 📊 **Portfolio Dashboard** | Live deal registry with sector & geographic concentration |
| 🧮 **SC-PD Credit Model** | Supply-Chain Adjusted Probability of Default |
| 💰 **Debt Structuring** | Senior / Mezzanine / Equity tranche optimizer |
| ⚡ **Stress Testing** | 7 deterministic scenarios × all projects |
| 🎲 **Monte Carlo** | P10/P50/P90 DSCR distribution with breach probability |
| 🤖 **ML Models** | Logistic Regression + XGBoost credit classifiers |
---
## 🚀 Quick Start
### Prerequisites
```bash
pip install -r requirements.txt
```
### Run the Interactive Dashboard
```bash
streamlit run streamlit_app/app.py
```
### Generate Data
```bash
cd data
python generate_data.py
```
### Run Credit Model
```bash
cd models
python credit_model.py
```
### Open Notebooks
```bash
jupyter notebook notebooks/
```
---
## 📁 Project Structure
```
infrarisk-lab/
├── README.md
├── requirements.txt
│
├── data/
│ ├── generate_data.py # Synthetic data generator
│ └── output/
│ ├── portfolio.csv # 8-project portfolio
│ ├── cashflows.csv # Annual cash flow projections
│ ├── risk_register.csv # Project risk registers
│ └── monte_carlo.csv # Monte Carlo simulation results
│
├── models/
│ └── credit_model.py # SC-PD model + ML classifiers
│
├── notebooks/
│ ├── 01_portfolio_analysis.ipynb # Portfolio EDA & visualization
│ ├── 02_credi …