Skip to content

sumit-raghav-06/customer-churn-intelligence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 Customer Churn Intelligence

End-to-end customer churn analysis using SQL, Python, exploratory data analysis (EDA), and machine learning to identify churn patterns and predict customer retention risk.


📌 Project Overview

Customer churn is one of the most important business challenges for subscription-based companies. This project analyzes customer behavior to identify the key factors influencing churn and develops a machine learning model to predict customers at risk of leaving.

The project combines SQL analysis, data visualization, exploratory data analysis (EDA), and predictive modeling to simulate a real-world business analytics workflow.


🎯 Objectives

  • Perform data cleaning and preprocessing
  • Analyze customer churn behavior using SQL and EDA
  • Visualize customer churn patterns and trends
  • Build a machine learning model for churn prediction
  • Generate actionable business insights for customer retention

🛠 Tools & Technologies

  • Python
  • Pandas
  • SQLite
  • Matplotlib
  • Seaborn
  • Scikit-learn
  • Jupyter Notebook

🗄 SQL-Based Analysis

SQL queries were used to analyze:

  • Churn rate by contract type
  • Average monthly charges by churn status
  • Customer tenure patterns
  • Customer retention behavior

📈 Exploratory Data Analysis (EDA)

The project includes visual analysis of:

  • Churn distribution
  • Contract type vs churn
  • Monthly charges vs churn
  • Tenure vs churn

Charts are stored in the charts/ directory.


📊 Sample Visualization

Churn Distribution

Churn Distribution

Tenure vs Churn

Churn Distribution

Contract Type vs Churn

Churn Distribution

Internet Service VS Churn

Churn Distribution


🤖 Machine Learning

A Logistic Regression model was developed to predict customer churn using customer demographic and service-related features.

Model evaluation includes:

  • Accuracy score
  • Confusion matrix
  • Business-focused interpretation

📊 Confusion Matrix

The confusion matrix below evaluates the model’s ability to correctly classify churned and retained customers.

Confusion Matrix


📌 Key Insights

  • Customers with month-to-month contracts show significantly higher churn rates
  • Customers paying $65+/month churn at 2x the rate
  • Customers with shorter tenure are more likely to leave
  • The model successfully identifies a large portion of churn-risk customers

Detailed findings are available in reports/insights.md.


# 📁 Project Structure

customer-churn-intelligence/
│
├── 01_data/
├── 02_notebooks/
│   └── customer_churn_analysis.ipynb
│
├── 03_charts/
├── 04_reports/
│   └── insights.md
│
├── 05_sql/
├── README.md
└── requirements.txt

🚀 How to Run

  1. Clone the repository

  2. Install dependencies:

pip install -r requirements.txt
  1. Launch Jupyter Notebook:
jupyter notebook
  1. Open and run the notebook from the notebooks/ folder.

✅ Conclusion

This project demonstrates an end-to-end data analytics workflow including:

  • Data cleaning and preprocessing
  • SQL-based business analysis
  • Exploratory data analysis (EDA)
  • Data visualization
  • Machine learning model development
  • Business-focused interpretation of results

The insights generated from this analysis can help businesses improve customer retention strategies and reduce customer attrition.

About

End-to-end customer churn analysis using SQL, Python, EDA, and machine learning with business-focused insights and predictive modeling.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages