# Rwanda Banking Churn Prediction System
A comprehensive machine learning application for predicting customer churn in the Rwandan banking sector. This system combines advanced data visualization with ensemble machine learning models to help banks identify at-risk customers and implement targeted retention strategies.
## 🏦 Overview
This application provides a complete solution for customer churn prediction in the Rwandan banking context, featuring:
- **Real-time Dashboard** with key performance metrics
- **Customer Lookup** with detailed risk assessment
- **Retention Management** with bulk actions and filtering
- **Advanced Analytics** with model evaluation and feature analysis
- **Configurable Settings** for model parameters and thresholds
## 🎥 Video Demo
Watch the application in action: Rwanda Banking Churn Prediction Demo
## 📊 Model Performance Results
### Initial Model Metrics
- **Accuracy**: 35.83%
- **Precision**: 29.56%
- **Recall**: 84.51%
- **F1 Score**: 43.80%
### Adjusted Threshold Metrics (Optimized for Maximum Recall)
- **Accuracy**: 29.58%
- **Precision**: 29.58%
- **Recall**: 100.0%
- **F1 Score**: 45.66%
### Confusion Matrix (Initial Model)
```
Predicted
Actual Negative Positive
Negative 26 143
Positive 11 60
```
### Confusion Matrix (Adjusted Threshold)
```
Predicted
Actual Negative Positive
Negative 0 169
Positive 0 71
```
## 🎯 Model Architecture
### Ensemble Model
- **Primary Model**: XGBoost Classifier
- **Secondary Model**: Logistic Regression
- **Ensemble Method**: Weighted combination for improved performance
### Best Hyperparameters
```python
{
'colsample_bytree': 0.7,
'learning_rate': 0.01,
'max_depth': 3,
'n_estimators': 300,
'scale_pos_weight': 3,
'subsample': 0.7
}
```
### Model Optimization
- **Threshold**: Adjusted to 0.3 for maximum recall
- **Class Imbalance**: Handled using SMOTE oversampling a …