An end-to-end Machine Learning web application that predicts customer churn risk using customer behavior, service usage, contract details, and payment information. The project includes data preprocessing, exploratory data analysis, model training, evaluation, explainability, and deployment using Streamlit.
Customer churn is a major business problem where companies lose existing customers. This project helps identify customers who are likely to leave so that businesses can take early action through retention strategies.
The platform predicts whether a customer is likely to churn and provides churn probability, risk level, and business recommendations.
- Customer churn prediction using Machine Learning
- Interactive Streamlit dashboard
- Single customer prediction
- Batch CSV prediction
- Churn probability and risk segmentation
- Exploratory Data Analysis
- Feature importance analysis
- SHAP-based explainability
- Business recommendations for customer retention
- Python
- Pandas
- NumPy
- Scikit-Learn
- Random Forest Classifier
- SHAP
- Matplotlib
- Seaborn
- Streamlit
- Pickle
- Data loading
- Data cleaning
- Handling missing values
- Encoding categorical features
- Feature scaling
- Train-test split
- Model training
- Model evaluation
- Model saving
- Streamlit deployment
- Accuracy: 80.55%
- F1 Score: 0.8002
- Model Used: Random Forest Classifier
The project uses the Telco Customer Churn dataset with customer demographic, account, service, and billing information.
Dataset shape:
Rows: 7,043
Columns: 21
customer-churn-platform/
│
├── dashboard/
│ ├── app.py
│ └── pages/
│
├── data/
│ └── raw/
│
├── models/
│ ├── random_forest.pkl
│ ├── scaler.pkl
│ └── model_columns.pkl
│
├── notebooks/
│
├── src/
│
├── assets/
│
├── requirements.txt
├── README.md
└── .gitignore
Clone the repository:
git clone https://github.com/vickycodeswith/customer-churn-platform.git
cd customer-churn-platformCreate a virtual environment:
python -m venv venvActivate the virtual environment:
For Windows:
venv\Scripts\activateFor macOS/Linux:
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun the Streamlit app:
streamlit run dashboard/app.pyThis project can help telecom companies:
- Identify high-risk churn customers
- Understand important churn factors
- Improve customer retention strategy
- Reduce revenue loss
- Support data-driven decision making
Nitesh Kumar Yadav B.Tech Computer Engineering Data Analyst | Python | SQL | Machine Learning | Streamlit