CoolFace
Apppublic

sevvaliclal/BinaryClassificationwithaBankChurnDataset

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes
App README

Customer Churn Prediction

An end-to-end machine learning project for predicting customer churn using structured banking data. The project covers the full pipeline from data analysis to model deployment readiness.


๐Ÿ“Œ Project Overview

The goal of this project is to predict whether a customer will leave the bank (Exited = 1) based on demographic, financial, and behavioral features.

The main focus is:

  • โ€”Robust feature engineering
  • โ€”Model comparison using multiple algorithms
  • โ€”ROC-AUCโ€“based evaluation for imbalanced data
  • โ€”Cross-validation and hyperparameter tuning
  • โ€”Saving the final model for inference and deployment

๐Ÿ“Š Dataset

  • โ€”Rows: 165,034
  • โ€”Target: Exited (binary classification)
  • โ€”No missing values
  • โ€”Categorical features encoded
  • โ€”Multiple engineered behavioral features added

โš™๏ธ Feature Engineering

Key engineered features include:

  • โ€”Balance usage indicator (HasBalance)
  • โ€”Balance per product ratio
  • โ€”Age and credit score segmentation
  • โ€”Activity ร— product interaction score
  • โ€”Tenure and salary-based ratios

Identifier columns (id, CustomerId, Surname) were removed to avoid noise.


๐Ÿค– Models Trained

The following models were evaluated:

  • โ€”Logistic Regression
  • โ€”Decision Tree
  • โ€”Random Forest
  • โ€”Gradient Boosting
  • โ€”AdaBoost
  • โ€”LightGBM
  • โ€”XGBoost
  • โ€”CatBoost

All models were evaluated using ROC-AUC as the primary metric.


๐Ÿ† Model Performance (ROC-AUC)

ModelROC-AUC
CatBoost0.8898
LightGBM0.8896
XGBoost0.8893
Gradient Boosting0.8881
AdaBoost0.8767
Random Forest0.8750
Logistic Regression0.8180

๐Ÿ” Validation & Tuning

  • โ€”Stratified K-Fold Cross Validation
  • โ€”RandomizedSearchCV for hyperparameter tuning
  • โ€”Class imbalance handled using class weights
  • โ€”Final model trained with optimal hyperparameters

๐Ÿš€ Deployment

The trained model is saved and can be used for inference via:

  • โ€”Streamlit
  • โ€”Hugging Face Spaces
  • โ€”Any Python-based backend

To run the Streamlit app locally:

bash
streamlit run app.py