This project predicts customer churn for a bank using machine learning models.
The goal is to identify customers who are likely to leave so that the business can take proactive retention actions.
- Source: Churn Modelling Dataset
- Records: 10,000 customers
- Features: Credit score, age, balance, tenure, salary, geography, etc.
- Target: Exited (1 = churn, 0 = not churn)
- Python
- Pandas, NumPy
- Matplotlib, Seaborn
- Scikit-learn
- Random Forest Classifier (Best Model)
- Logistic Regression
- Support Vector Machine (SVM)
- K-Nearest Neighbors (KNN)
- Gradient Boosting
| Model | Accuracy |
|---|---|
| Random Forest | 86.5% |
| Gradient Boosting | 86.7% |
| KNN | 83% |
| Logistic Regression | 81% |
| SVM | 80% |
- Random Forest Classifier
- Accuracy: 86.5%
- Precision (Churn): 0.75
- Recall (Churn): 0.47
- Model performs better on non-churn customers
- Struggles to detect churn cases (class imbalance issue)
- Feature engineering improved model performance
- Class imbalance affects recall
- Some models underperform on minority class
- Apply SMOTE for imbalance handling
- Use XGBoost / LightGBM
- Hyperparameter tuning (GridSearchCV)
- Adjust decision threshold for better recall
- churn_prediction.ipynb → Full analysis and model building
- churn_prediction.html → Report version of notebook
- Churn_Modelling.csv → Dataset
Sahel Ahmed