Skip to content

AxArjun/telco-customer-churn-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telco Customer Churn Analysis & Prediction

Python Pandas NumPy Scikit-Learn SQL SQLite Power BI Random Forest Machine Learning Customer Analytics Data Visualization Jupyter Notebook Google Colab License: MIT Project Status mBusiness Intelligence Revenue Analytics GitHub

Overview

This project delivers an end-to-end Customer Churn Analytics solution using SQL, Python, Machine Learning, and Power BI.

The objective is to identify key drivers of customer churn, quantify revenue risk, predict customer attrition, and provide actionable business recommendations for customer retention.

The project combines:

  • SQL-based business analysis
  • Exploratory Data Analysis (EDA)
  • Feature Engineering
  • Machine Learning Prediction
  • Interactive Power BI Executive Dashboard

Business Problem

Customer churn directly impacts revenue and profitability in the telecommunications industry.

This project aims to answer:

  • Which customers are most likely to churn?
  • What factors contribute most to churn?
  • How much revenue is at risk?
  • Which customer segments should be prioritized for retention?
  • What actions can reduce churn and improve customer lifetime value?

Dataset

Telco Customer Churn Dataset

Dataset Size:

  • 7,043 customers
  • 33 business attributes
  • Demographics
  • Services subscribed
  • Billing information
  • Churn indicators
  • Customer Lifetime Value (CLTV)

Key Fields:

  • Gender
  • Senior Citizen
  • Partner
  • Dependents
  • Tenure Months
  • Internet Service
  • Contract Type
  • Monthly Charges
  • Total Charges
  • Churn Label
  • Churn Score
  • CLTV

Project Architecture

Dataset ↓ SQL Analytics ↓ EDA & Business Insights ↓ Feature Engineering ↓ Random Forest Model ↓ Churn Predictions ↓ Power BI Executive Dashboard


Repository Structure

telco-customer-churn-analysis/

├── data/
│   ├── Telco_customer_churn.xlsx
│   ├── churn_predictions.csv
│   └── feature_importance.csv
│
├── notebooks/
│   ├── 01_sql_analytics.ipynb
│   ├── 02_eda.ipynb
│   ├── 03_feature_engineering.ipynb
│   └── 04_churn_prediction.ipynb
│
├── powerbi/
│   ├── Customer churn prediction.pbix
│   └── screenshots/
│
├── src/
│   └── convert_to_csv.py
│
├── LICENSE
└── README.md

SQL Analytics

Key business questions answered:

Contract Type Analysis

Month-to-Month customers exhibited significantly higher churn rates than annual contract customers.

Revenue Risk Analysis

Revenue exposure was quantified by customer segment and churn category.

Service Impact Analysis

Customer retention was strongly associated with:

  • Online Security
  • Tech Support
  • Contract Length

Customer Risk Segmentation

Customers were classified into:

  • High Risk
  • Medium Risk
  • Low Risk

using churn score thresholds.


Exploratory Data Analysis

Performed:

  • Missing value analysis
  • Distribution analysis
  • Churn segmentation
  • Correlation analysis
  • Revenue analysis
  • Customer profile exploration

Key Insights:

  • Short tenure customers churn more frequently.
  • Month-to-Month contracts are the strongest churn driver.
  • Customers lacking Online Security and Tech Support exhibit higher churn rates.
  • Fiber Optic customers show elevated churn risk.

Feature Engineering

Implemented:

  • Missing value handling
  • Data type corrections
  • Label encoding
  • One-hot encoding
  • Feature preparation for machine learning

Generated outputs:

  • Model-ready dataset
  • Feature importance dataset
  • Prediction dataset

Machine Learning

Model Used:

  • Random Forest Classifier

Evaluation Metrics:

Metric Score
Accuracy 80.7%
Precision 64.1%
Recall 53.5%
F1 Score 57.7%
ROC-AUC 84.3%

Top Predictive Features:

  1. Tenure Months
  2. Total Charges
  3. Monthly Charges
  4. Contract Type
  5. Online Security
  6. Tech Support
  7. Internet Service

Power BI Dashboard

The dashboard contains 7 executive-level pages:

Executive Summary & Revenue Impact

  • Churn KPIs
  • Revenue at Risk
  • Customer Segmentation

Churn Drivers

  • Contract Analysis
  • Service Analysis
  • Churn Trends

Voice of Customer

  • Churn Reason Analysis
  • Competitor Insights
  • Service Quality Insights

Customer Risk Intelligence

  • High-Risk Customer Segmentation
  • Churn Score Analysis

Executive Recommendations

  • Strategic Retention Recommendations
  • Revenue Protection Opportunities

AI Churn Insights

  • Machine Learning Results
  • Feature Importance Analysis

Retention Simulator

  • What-if Analysis
  • Revenue Recovery Estimation
  • Customer Retention Impact

Business Recommendations

  1. Prioritize Month-to-Month customers for retention campaigns.
  2. Bundle Online Security and Tech Support services.
  3. Target low-tenure customers within their first year.
  4. Focus retention efforts on high-risk customer segments.
  5. Offer incentives for migration to annual contracts.

Technologies Used

Analytics

  • SQL
  • SQLite

Programming

  • Python
  • Pandas
  • NumPy

Machine Learning

  • Scikit-Learn
  • Random Forest

Visualization

  • Matplotlib
  • Seaborn
  • Power BI

Results

The project demonstrates how data analytics and machine learning can be combined to:

  • Predict customer churn
  • Quantify revenue risk
  • Prioritize retention actions
  • Improve customer lifetime value
  • Support executive decision making

Author

Arjun Ramprasad

🤝 Contributing

Contributions, issue tracking, and feature recommendations are highly welcome. Feel free to fork this project, create a feature branch, and submit a pull request!

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

End-to-end customer churn analysis for a telecom provider — SQL analytics, EDA, feature engineering, and a Random Forest classifier, visualized through an interactive Power BI dashboard for retention strategy.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages