Customer churn is one of the most critical challenges faced by subscription-based businesses.
This project focuses on predicting customer churn using multiple machine learning classification algorithms, helping businesses identify at-risk customers early and take proactive retention actions.
๐น The project includes data preprocessing, exploratory data analysis, model training, evaluation, and comparison of multiple ML algorithms to select the best-performing model.
๐ GitHub Repo: Link
๐ Live Demo: Link
- ๐ Analyze customer behavior data
- ๐ค Train and compare multiple ML classification models
- ๐ Evaluate models using Accuracy, Precision, Recall & F1-score
- ๐ Select the best-performing model for churn prediction
- ๐ Prepare the project for real-world deployment (Streamlit-ready)
- Logistic Regression
- Decision Tree Classifier
- K-Nearest Neighbors (KNN)
- Support Vector Machine (SVM)
- Naive Bayes
- Random Forest Classifier
- AdaBoost Classifier
- Gradient Boosting Classifier
Each model is evaluated using:
- โ Accuracy
- ๐ฏ Precision
- ๐ Recall
- ๐ F1-Score
A comparative performance table is generated to identify the best model.
โ XGBoost Classifier (trained separately) was identified as the best-performing model, delivering superior performance across all evaluation metrics.
๐ PCA was also tested, but no significant improvement in performance was observed.
Customer-Churn-Prediction/
โ
โโโ Customer Churn Prediction.ipynb # Model training & analysis
โโโ app.py # Streamlit web application
โโโ customer_churn_classifier.pkl # Trained ML model
โโโ customer_churn_large_dataset.xlsx # Dataset
โโโ README.md # Project documentation
โโโ requirements.txt # Python dependencies
โโโ .gitignore # Ignored files
โโโ venv/ # Virtual environment (ignored)
- ๐ Python
- ๐ Pandas, NumPy
- ๐ค Scikit-learn
- ๐ Matplotlib, Seaborn
- ๐ Streamlit
- ๐ Jupyter Notebook
# Clone the repository
git clone https://github.com/your-username/customer-churn-prediction.git
# Navigate to project folder
cd customer-churn-prediction
# Install dependencies
pip install -r requirements.txt
# Open Jupyter Notebook
jupyter notebookRun the Streamlit application
streamlit run app.py
Once the app starts, open the browser and visit: ๐ http://localhost:8501/
The web app allows:
- ๐ Viewing data insights
- ๐ค Understanding model performance
- ๐ฎ Predicting customer churn in real time
This project includes a Streamlit-based web application and is ready for deployment on:
- Streamlit Cloud
- Localhost
- Any cloud VM (AWS / Azure / GCP)
- End-to-end ML pipeline development
- Handling categorical & numerical data
- Model comparison & evaluation
- Overfitting analysis
- Real-world ML project structuring
This project is licensed under the MIT License.
Piyush Kumar
๐ Data Science & Machine Learning Developer
๐ Portfolio ย โขย ๐ป GitHub ย โขย ๐ผ LinkedIn ย โขย ๐ง Email