๐ Try the application here:
https://customer-churn-predictor-vk18.streamlit.app/
Customer churn is one of the biggest challenges faced by subscription-based businesses.
This project predicts whether a telecom customer is likely to leave the service using Machine Learning.
The system analyzes customer demographics, account information, subscribed services, and billing details to estimate churn probability and provide actionable business recommendations.
This project follows a complete Data Science workflow:
Data Collection
โ
Exploratory Data Analysis
โ
Data Preprocessing
โ
Feature Engineering
โ
Handling Class Imbalance
โ
Model Training
โ
Model Evaluation
โ
Interactive Dashboard Deployment
Telecom companies lose revenue when customers discontinue services. Identifying customers who are likely to churn allows companies to take preventive actions.
The objective is to build a machine learning solution that:
- Predicts customer churn probability
- Identifies important churn factors
- Provides retention recommendations
- Helps businesses reduce customer loss
Dataset Used:
IBM Telco Customer Churn Dataset
The dataset contains customer information including:
- Customer demographics
- Account information
- Internet services
- Phone services
- Contract details
- Payment information
| Attribute | Information |
|---|---|
| Total Records | 7043 Customers |
| Target Variable | Churn |
| Problem Type | Binary Classification |
| Classes | Yes / No |
- Python
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Scikit-Learn
- Imbalanced Learn (SMOTE)
- Joblib
- Streamlit
- VS Code
- Jupyter Notebook
- Git & GitHub
Customer-Churn-Prediction/
โ
โโโ app/
โ โโโ app.py
โ โโโ utils.py
โ
โโโ data/
โ โโโ raw/
โ โโโ Telco-Customer-Churn.csv
โ
โโโ models/
โ โโโ gradient_boosting_model.pkl
โ โโโ preprocessor.pkl
โ
โโโ notebooks/
โ โโโ 01_data_understanding.ipynb
โ โโโ 02_eda.ipynb
โ โโโ 03_preprocessing.ipynb
โ โโโ 04_model_training.ipynb
โ
โโโ reports/
โ โโโ figures/
โ
โโโ src/
โ โโโ preprocessing.py
โ โโโ feature_engineering.py
โ โโโ train.py
โ โโโ evaluate.py
โ โโโ predict.py
โ โโโ pipeline.py
โ
โโโ requirements.txt
โโโ README.md
โโโ LICENSE
โโโ .gitignore
Performed detailed analysis including:
โ Churn distribution
โ Gender based analysis
โ Contract impact
โ Internet service effect
โ Monthly charges analysis
โ Tenure relationship
โ Payment method analysis
Steps performed:
- Removed invalid records
- Converted incorrect data types
- Fixed missing TotalCharges values
Applied:
- One Hot Encoding
- Feature Scaling
The dataset was imbalanced.
Used:
SMOTE
(Synthetic Minority Oversampling Technique)
Before SMOTE:
No Churn > Churn
After SMOTE:
No Churn = Churn
Multiple algorithms were trained:
| Model |
|---|
| Logistic Regression |
| Decision Tree |
| Random Forest |
| Gradient Boosting |
| Histogram Gradient Boosting |
After evaluation:
Gradient Boosting Classifier
| Metric | Score |
|---|---|
| Accuracy | 77% |
| ROC-AUC Score | 0.84 |
| Precision | 0.56 |
| Recall | 0.69 |
| F1 Score | 0.62 |
The project includes a complete interactive dashboard.
Features:
โ Customer information input
โ Real-time churn prediction
โ Churn probability score
โ Customer risk category
โ Business recommendations
โ Important churn factors
โ Customer summary report
git clone https://github.com/YOUR_USERNAME/Customer-Churn-Prediction.gitNavigate:
cd Customer-Churn-Predictionpython -m venv .venvActivate:
Windows:
.venv\Scripts\activateLinux/Mac:
source .venv/bin/activatepip install -r requirements.txtstreamlit run app/app.pyThe application is deployed using Streamlit Cloud.
Deployment workflow:
- Source code pushed to GitHub
- Streamlit Cloud connected with repository
- Python environment configured
- Dependencies installed from requirements.txt
- Application served using Streamlit
โ Complete Machine Learning Pipeline
โ Professional Streamlit Dashboard
โ Data Cleaning & Feature Engineering
โ Multiple Model Comparison
โ SMOTE Class Balancing
โ Probability Based Prediction
โ Risk Level Classification
โ Business Recommendation System
โ Interactive User Interface
- Deploy application online
- Add database support
- Add customer analytics dashboard
- Improve model accuracy
- Add Explainable AI using SHAP
Deepak Kumar Jha
AI & Data Science Enthusiast
Skills:
- Machine Learning
- Data Science
- Python Development
If you found this project useful, consider giving it a โญ on GitHub.
Made with โค๏ธ using Python and Machine Learning




