This project is a customer churn prediction system for a telecom company. The goal is to analyze customer data and predict whether a customer is likely to churn based on various features such as tenure, contract type, monthly charges, and internet services.
The dataset consists of 7043 rows and 21 columns. The key features include:
- Demographic Information: Gender, Senior Citizen, Partner, Dependents
- Service Information: Phone Service, Multiple Lines, Internet Service, Streaming Services
- Billing Information: Contract Type, Payment Method, Monthly Charges, Total Charges
- Target Variable: Churn (Yes/No)
After preprocessing, the final model is trained on 16 selected features after applying feature engineering techniques such as encoding categorical variables and handling missing values.
The Random Forest Classifier is used for prediction. Data balancing is performed using SMOTE (Synthetic Minority Over-sampling Technique) to handle class imbalance.
- Accuracy: 85%
- Precision: 84%
- Recall: 85%
- ROC AUC Score: 85%
To run this project, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/telco-churn-prediction.git cd telco-churn-prediction -
Create a virtual environment (optional but recommended):
python -m venv venv # Windows source venv/bin/activate # Mac/Linux venv\Scripts\activate # Windows (PowerShell)
-
Install dependencies:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run app.py
├── data/
├── models/
├── app.py
├── churn_model.pkl
├── requirements.txt
├── README.md
- Enter customer details in the Streamlit app.
- Click "Predict Churn" to see the prediction result along with the confidence percentage.
- The model will predict whether a customer is likely to churn.
- Hyperparameter tuning for better accuracy.
- Deploying the model using AWS/GCP/Heroku.
- Adding Explainability with SHAP values.
This project is open-source and available under the MIT License.
Developed by Vaibhav Pal. Contributions are welcome!