Logo Lanfrica

FnuAbhijith/Municipal-Debt-Risk-Analysis-using-Machine-Learning

Domain:

socioeconomic

Record type:

project
Creator:
Fnu
Host:
Predicting municipal bad debt using machine learning models (CatBoost, MLP, Random Forest) on South African financial data. A capstone project focused on real-world risk analysis and debt prediction. # Municipal-Debt-Risk-Analysis-using-Machine-Learning This project predicts bad debt in South African municipalities using machine learning models like CatBoost, MLP, and Random Forest. 🔹 Problem Statement Municipalities in South Africa often face challenges with debt repayment, leading to financial instability. Banks and government agencies need to predict which accounts are likely to default so they can take preventive action (e.g., early intervention, payment restructuring). Goal: Build a machine learning model to classify accounts as high-risk or low-risk based on financial and demographic features. 🔹 Dataset - Source: Kaggle – South African Municipal Debt Risk Dataset - Size: ~150,000 accounts - Features include: - Demographic: age, gender, location - Financial: income, credit history, account balance - Municipality: service usage, arrears, payment history - Target: risk_flag (1 = high-risk, 0 = low-risk) 🔹 Approach 1. Data Preparation - Cleaned missing values with median/most frequent imputation - One-hot encoded categorical variables (municipality, gender, etc.) - Normalized numeric features 2. Train-Test Split - 80/20 split, stratified by risk_flag - Also tested time-based split (train on earlier records, test on later ones) to avoid data leakage 3. Models Used - Logistic Regression (baseline) - Random Forest Classifier - MLP (Neural Network) - CatBoost Classifier (handled categorical features efficiently) 4. Evaluation Metrics - Accuracy - ROC-AUC - Precision / Recall / F1 - Confusion Matrix ## 🔹 Results | Model | Accuracy | ROC-AUC | F1 | |---------------------|----------|---------|----| | Logistic Regression | 0.82 | 0.85 | 0.78 | | Random Forest | 0.91 | 0.94 | 0.89 | | MLP | 0.89 | 0.92 | 0.87 | | **CatBoost** | **0.93** | **0.95**| **0.91** | ⚠️ Note on AUC: Initial runs gave an AUC close to 1.0, which signaled possible data leakage. After fixing (time-bas …