Skip to content

About

AI-powered Bank Customer Churn Prediction and Retention Intelligence System

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

🏦 AI-Powered Bank Customer Churn Prediction & Retention Intelligence System

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


📌 Project Overview

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.


🎯 Business Objective

  • Reduce customer churn.
  • Improve retention campaign effectiveness.
  • Enable proactive customer engagement.
  • Support business teams with interpretable risk insights.

🧠 Machine Learning Workflow

  1. Data Cleaning
  2. Exploratory Data Analysis (EDA)
  3. Feature Engineering
  4. Feature Selection
  5. Train-Test Split
  6. Feature Scaling
  7. Model Training
  8. Model Comparison
  9. Cross-Validation
  10. Hyperparameter Tuning
  11. Threshold Optimization
  12. Retention Intelligence Integration
  13. Streamlit Deployment

🏗️ Solution Architecture

Customer Data
      ↓
EDA & Feature Engineering
      ↓
Feature Selection
      ↓
Train-Test Split
      ↓
StandardScaler
      ↓
Logistic Regression
      ↓
Threshold Optimization (0.30)
      ↓
Retention Intelligence Engine
      ↓
Streamlit Web Application

📊 Dataset

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)


⚙️ Models Evaluated

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

✅ Final Selected Model

Baseline Logistic Regression

Chosen because it achieved the best overall balance between Precision, Recall, F1-score, interpretability, and business usability.


🔍 Threshold Optimization

Instead of using the default probability threshold of 0.50, multiple thresholds were tested.

Final Business Threshold: 0.30

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

💡 Retention Intelligence System

The deployed application generates business recommendations based on churn probability.

Risk Levels

  • 🔴 High Risk
  • 🟠 Medium Risk
  • 🟡 Low Risk
  • 🟢 Stable Customer

Example Actions

  • Immediate retention call
  • Personalized offer
  • Loyalty program enrollment
  • Engagement monitoring
  • Relationship manager follow-up

🖥️ Streamlit Dashboard Features

  • Customer profile input form
  • Transaction summary
  • Churn probability prediction
  • Risk classification
  • SLA prioritization
  • Next-best-action recommendation
  • Offer recommendation
  • Downloadable retention report

Dashboard Preview

Dashboard Risk Analysis

🚀 Live Application

🔗 Public Streamlit App https://bankchurnretentionsystem-dn4cosylzd2y72yrse22h6.streamlit.app/


📁 Project Structure

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

🛠️ Tech Stack

Programming: Python ML: scikit-learn Data: pandas, NumPy Deployment: Streamlit Cloud Model Serialization: joblib Version Control: Git & GitHub


▶️ Run Locally

Clone Repository

git clone https://github.com/Gitprem2004/Bank_Churn_Retention_System.git
cd Bank_Churn_Retention_System

Install Dependencies

pip install -r requirements.txt

Run Application

streamlit run app.py

📈 Key Business Impact

  • Earlier churn detection
  • Focused retention campaigns
  • Reduced unnecessary outreach
  • Better customer prioritization
  • Actionable retention intelligence
  • Improved decision support for business teams

🧩 Challenges Faced

  • 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.


🔮 Future Enhancements

  • XGBoost / LightGBM experimentation
  • SHAP explainability
  • CRM integration
  • Real-time API deployment
  • Automated retention workflow engine

📚 What I Learned

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

👨‍💻 Author

Premkumar S B.Tech – Artificial Intelligence & Data Science Chennai, India


⭐ If you found this project useful

Please consider giving this repository a star ⭐ on GitHub.

About

AI-powered Bank Customer Churn Prediction and Retention Intelligence System

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages