An end-to-end machine learning project that performs EDA, compares multiple models (Logistic Regression, Random Forest, XGBoost), tunes hyperparameters, and deploys a real-time churn prediction app using Streamlit — achieving 86% ROC-AUC on the IBM Telco dataset.
🔗 Live Demo: customer-churn-prediction-pranjal-pandey-003.streamlit.app
Customer churn is one of the biggest challenges in the telecom industry. This project builds a predictive ML pipeline that identifies at-risk customers based on their demographics, services, and billing information — helping businesses take proactive retention measures.
- Predicts churn probability in real-time
- Interactive UI with dropdowns and sliders for all customer attributes
- Risk level categorization: 🔴 High / 🟡 Medium / 🟢 Low
- XGBoost model trained with class imbalance handling
- Model trains on startup — no pickle version issues
| Layer | Tools |
|---|---|
| ML Model | XGBoost, Scikit-learn |
| Data Processing | Pandas, NumPy |
| Frontend | Streamlit |
| Deployment | Streamlit Cloud |
| Version Control | Git, GitHub |
| Model | ROC AUC | F1 Score | Recall |
|---|---|---|---|
| Logistic Regression | 0.86 | 0.64 | 0.84 |
| Random Forest (Tuned) | 0.85 | 0.65 | 0.78 |
| XGBoost ✅ | 0.86 | 0.65 | 0.80 |
XGBoost selected as final model for best overall balance of precision, recall and AUC.
Customer-Churn-Prediction/
├── app.py # Streamlit frontend + model training
├── requirements.txt # Dependencies
├── Telco_Customer_Churn.csv # Dataset (IBM Telco)
├── Customer_Churn_Prediction.ipynb # EDA + model experiments
└── .gitignore
Demographics: Gender, Senior Citizen, Partner, Dependents
Services: Phone Service, Multiple Lines, Internet Service, Online Security, Online Backup, Device Protection, Tech Support, Streaming TV, Streaming Movies
Billing: Contract Type, Paperless Billing, Payment Method, Monthly Charges, Total Charges, Tenure
# Clone the repo
git clone https://github.com/venom312004/Customer-Churn-Prediction.git
cd Customer-Churn-Prediction
# Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Mac/Linux
# Install dependencies
pip install -r requirements.txt
# Run the app
streamlit run app.pyIBM Telco Customer Churn Dataset
- 7,043 customers
- 21 features
- Target:
Churn(Yes/No) - Class imbalance handled via
scale_pos_weightin XGBoost
Pranjal Pandey
- GitHub: @venom312004
- B.Tech Data Science & AI | GGSIPU Delhi