Skip to content

AgrimaMishra/Customer_Churn_Prediction_Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customer Churn Prediction using Machine Learning

Project Overview

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.


Business Objective

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

Dataset Description

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)

Tech Stack & Tools

  • Programming Language: Python
  • Libraries: Pandas, NumPy, Matplotlib, Seaborn
  • Machine Learning: Scikit-learn
  • Model Used: Decision Tree Classifier
  • Deployment: Streamlit
  • Version Control: Git & GitHub

Project Workflow

  1. Exploratory Data Analysis (EDA)

    • Churn distribution analysis
    • Feature-wise churn trends
    • Identification of high-risk segments
  2. Feature Engineering

    • Handling categorical and numerical variables
    • One-Hot Encoding using ColumnTransformer
    • Target variable encoding
  3. Model Building

    • ML pipeline creation (Preprocessing + Model)
    • Decision Tree training
    • Performance evaluation
  4. Hyperparameter Tuning

    • GridSearchCV for optimal model parameters
  5. *Model Interpretation

    • Feature importance analysis
    • Linking model results with business reasoning
  6. Deployment

    • Interactive Streamlit web application
    • Real-time churn prediction with probability

Key Business Insights

  • 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

Business Recommendations

  • 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

Streamlit Application

The deployed Streamlit app allows users to:

  • Enter customer details
  • Instantly predict churn risk
  • View churn probability
  • Classify customers as High / Medium / Low risk

Business Impact

  • 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.


How to Run the Project Locally

Clone the repository

git clone

Create virtual environment

python -m venv venv

Activate environment

venv\Scripts\activate

Install dependencies

pip install -r requirements.txt

Run Streamlit app

streamlit run app.py

Final Takeaway

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.

About

Using historical customer data, machine learning techniques, and business-oriented analysis, this project delivers both predictive power and actionable business insights. This project focuses on predicting customer churn before it happens and uncovering the key factors that drive customer attrition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors