Predict which bank customers are likely to leave (churn) using machine learning and interactive data analysis.
This project is Task 2 of my Data Science Internship at DevelopersHub Corporation.
- Churn Modelling Dataset (Kaggle link)
- 10,000 records, 14 features
- Target:
Exited(1 = Churned, 0 = Stayed)
- Data Cleaning: Removed irrelevant columns, handled categorical variables.
- Feature Engineering: Encoded categorical features (Geography, Gender).
- Exploratory Data Analysis (EDA): Interactive visualizations with Plotly for demographics, financials, and activity.
- Feature Scaling: Standardized numerical features.
- Model Training: Compared Logistic Regression, Decision Tree, Random Forest, and Gradient Boosting.
- Evaluation: Used accuracy, F1, precision, recall, ROC curve, and confusion matrix.
- Feature Importance: Identified key drivers of churn.
- Business Insights: Actionable recommendations for customer retention.
| Model | Accuracy | F1 Score | AUC |
|---|---|---|---|
| Logistic Regression | ~81% | ~0.45 | ~0.77 |
| Decision Tree | ~79% | ~0.50 | ~0.72 |
| Random Forest | ~86% | ~0.58 | ~0.86 |
| Gradient Boosting | ~86% | ~0.60 | ~0.87 |
- Best Model: Gradient Boosting (~86% accuracy, ~0.60 F1)
- Age is the strongest predictor — older customers churn more.
- Geography: German customers have 2x higher churn.
- Inactive members and those with 3+ products are at highest risk.
- Credit score and salary have minimal impact on churn.
- Python 3.x
- Pandas, NumPy
- Plotly (interactive EDA & model evaluation)
- Scikit-learn
- Clone the repository:
git clone https://github.com/kinzaemann/churn-modelling.git cd churn-modelling - Install dependencies:
pip install -r requirements.txt
- Open and run the notebook:
customer_churn_prediction.ipynb
├── README.md
├── requirements.txt
├── customer_churn_prediction.ipynb # Main notebook
└── data/
└── Churn_Modelling.csv # Dataset (add or download from Kaggle)
For questions or feedback, please open an issue or connect on LinkedIn.
*Completed as part of Data Science Internship at Developers Hub Corporation).