An end-to-end Machine Learning + Business Intelligence project that predicts bank customer churn and provides actionable retention recommendations through a deployed Streamlit web application.
🔗 Live Demo: https://bankchurnretentionsystem-dn4cosylzd2y72yrse22h6.streamlit.app/
📂 GitHub Repository: https://github.com/Gitprem2004/Bank_Churn_Retention_System
Customer churn is a major challenge for banks because losing existing customers directly affects revenue and customer lifetime value. This project builds a Churn Prediction & Retention Intelligence System that:
- Predicts churn probability for individual customers.
- Identifies high-risk customers proactively.
- Prioritizes retention actions.
- Recommends next-best actions and customer offers.
- Provides a business-friendly dashboard for decision-making.
The solution combines machine learning, feature engineering, threshold optimization, and deployment engineering into a complete production-style workflow.
- Reduce customer churn.
- Improve retention campaign effectiveness.
- Enable proactive customer engagement.
- Support business teams with interpretable risk insights.
- Data Cleaning
- Exploratory Data Analysis (EDA)
- Feature Engineering
- Feature Selection
- Train-Test Split
- Feature Scaling
- Model Training
- Model Comparison
- Cross-Validation
- Hyperparameter Tuning
- Threshold Optimization
- Retention Intelligence Integration
- Streamlit Deployment
Customer Data
↓
EDA & Feature Engineering
↓
Feature Selection
↓
Train-Test Split
↓
StandardScaler
↓
Logistic Regression
↓
Threshold Optimization (0.30)
↓
Retention Intelligence Engine
↓
Streamlit Web Application
The dataset includes customer demographic and banking behavior features such as:
- Age
- Monthly Income
- Years with Bank
- Debit Amount
- Credit Amount
- Debit Transaction Count
- Credit Transaction Count
- Gender
- Marital Status
Target Variable: Status (1 = Churn, 0 = Active)
| Model | Accuracy | Precision | Recall | F1-score |
|---|---|---|---|---|
| Logistic Regression | 0.856 | 0.636 | 0.467 | 0.539 |
| Decision Tree | 0.804 | 0.452 | 0.422 | 0.437 |
| Random Forest | 0.840 | 0.593 | 0.356 | 0.444 |
| Random Forest (Balanced) | 0.848 | 0.640 | 0.356 | 0.457 |
Baseline Logistic Regression
Chosen because it achieved the best overall balance between Precision, Recall, F1-score, interpretability, and business usability.
Instead of using the default probability threshold of 0.50, multiple thresholds were tested.
This improved churn capture and made the system more useful for retention teams.
- Probability ≥ 0.30 → High Churn Risk
- Probability < 0.30 → Low Churn Risk
The deployed application generates business recommendations based on churn probability.
- 🔴 High Risk
- 🟠 Medium Risk
- 🟡 Low Risk
- 🟢 Stable Customer
- Immediate retention call
- Personalized offer
- Loyalty program enrollment
- Engagement monitoring
- Relationship manager follow-up
- Customer profile input form
- Transaction summary
- Churn probability prediction
- Risk classification
- SLA prioritization
- Next-best-action recommendation
- Offer recommendation
- Downloadable retention report
🔗 Public Streamlit App https://bankchurnretentionsystem-dn4cosylzd2y72yrse22h6.streamlit.app/
Bank_Churn_Retention_System/
│
├── app.py
├── requirements.txt
├── README.md
├── .gitignore
│
├── models/
│ ├── churn_model.pkl
│ ├── scaler.pkl
│ └── feature_names.pkl
│
├── notebook/
│ └── Bank_Churn_Analysis.ipynb
│
├── presentation/
│ └── Bank_Churn_Senior_ML_Client_Presentation_Jii.pptx
│
├── images/
│ ├── dashboard_home.png
│ ├── dashboard_analysis.png
│ └── architecture.png
│
└── data/
└── sample_data.csv
Programming: Python ML: scikit-learn Data: pandas, NumPy Deployment: Streamlit Cloud Model Serialization: joblib Version Control: Git & GitHub
git clone https://github.com/Gitprem2004/Bank_Churn_Retention_System.git
cd Bank_Churn_Retention_Systempip install -r requirements.txtstreamlit run app.py- Earlier churn detection
- Focused retention campaigns
- Reduced unnecessary outreach
- Better customer prioritization
- Actionable retention intelligence
- Improved decision support for business teams
- Class imbalance handling
- Threshold selection for business use case
- Feature consistency during deployment
- Model loading path issues
- Streamlit cloud dependency management
Each issue was resolved and documented during the project lifecycle.
- XGBoost / LightGBM experimentation
- SHAP explainability
- CRM integration
- Real-time API deployment
- Automated retention workflow engine
This project helped me understand the complete machine learning lifecycle:
- Data preprocessing
- Feature engineering
- Model evaluation
- Business interpretation
- Threshold tuning
- Deployment preparation
- Public cloud deployment
- Technical documentation
- Stakeholder communication
Premkumar S B.Tech – Artificial Intelligence & Data Science Chennai, India
- GitHub: https://github.com/Gitprem2004
- LinkedIn: https://www.linkedin.com/in/prem19
Please consider giving this repository a star ⭐ on GitHub.

