Customer churn is a critical challenge for subscription-based businesses like telecom companies. Acquiring a new customer is significantly more expensive than retaining an existing one. This project focuses on predicting customer churn before it happens and uncovering the key factors that drive customer attrition.
Using historical customer data, machine learning techniques, and business-oriented analysis, this project delivers both predictive power and actionable business insights.
The primary objectives of this project are:
- Predict whether a customer is likely to churn
- Identify high-risk customers early
- Understand the major drivers of churn
- Enable proactive, data-driven retention strategies
The dataset contains customer-level information such as:
- Demographics (gender, senior citizen, dependents)
- Account information (tenure, contract type, payment method)
- Service usage (internet services, security, tech support)
- Billing details (monthly charges, total charges)
- Target variable: Churn (Yes / No)
- Programming Language: Python
- Libraries: Pandas, NumPy, Matplotlib, Seaborn
- Machine Learning: Scikit-learn
- Model Used: Decision Tree Classifier
- Deployment: Streamlit
- Version Control: Git & GitHub
-
Exploratory Data Analysis (EDA)
- Churn distribution analysis
- Feature-wise churn trends
- Identification of high-risk segments
-
Feature Engineering
- Handling categorical and numerical variables
- One-Hot Encoding using
ColumnTransformer - Target variable encoding
-
Model Building
- ML pipeline creation (Preprocessing + Model)
- Decision Tree training
- Performance evaluation
-
Hyperparameter Tuning
- GridSearchCV for optimal model parameters
-
*Model Interpretation
- Feature importance analysis
- Linking model results with business reasoning
-
Deployment
- Interactive Streamlit web application
- Real-time churn prediction with probability
- Month-to-month contract customers are most likely to churn
- High monthly charges significantly increase churn risk
- Lack of value-added services (security, support) leads to attrition
- New customers (low tenure) are more churn-prone
- Automatic payment methods reduce churn likelihood
- Convert short-term customers to long-term contracts using incentives
- Introduce bundled service packages to improve perceived value
- Focus retention efforts during the first 90 days of customer tenure
- Encourage auto-payment adoption through discounts or cashback
The deployed Streamlit app allows users to:
- Enter customer details
- Instantly predict churn risk
- View churn probability
- Classify customers as High / Medium / Low risk
- Enables proactive churn prevention
- Reduces revenue loss
- Improves customer lifetime value
- Supports data-driven decision making
Even a 5–10% reduction in churn can result in substantial revenue savings.
git clone
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
streamlit run app.py
Customer churn is predictable and preventable. By combining machine learning with business understanding, this project transforms raw data into meaningful insights that help businesses retain customers and optimize strategy.