Skip to content

About

Analyzed customer churn for a telecom company using R. Performed data cleaning, exploratory analysis, and feature engineering to identify key churn drivers. Built a logistic regression model to predict high-risk customers (~80% accuracy) and provided actionable retention strategies.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Customer Churn Analysis Using R

Analyzed customer churn for a telecom company using R. The project cleans the raw data, explores churn drivers, engineers features and builds a logistic regression model to flag high-risk customers (~80% accuracy), then turns the findings into retention recommendations.

Business Problem

Customer acquisition is costly, so growth depends on retaining existing customers. Telecom companies lose a large share of short-tenure and month-to-month customers. This project answers:

  • Which factors drive churn?
  • Which customer segments are most at risk?
  • Can we predict churn probability early enough to act?

Dataset

Telco Customer Churn Dataset (Kaggle). The raw CSV is not committed; download telco_churn.csv from Kaggle and place it in the repo root to run the pipeline from scratch. The cleaned intermediates (cleaned_churn_data.csv, final_churn_data.csv) are included.

Pipeline

Script What it does
01_data_cleaning.R Loads telco_churn.csv, coerces TotalCharges to numeric, drops incomplete rows, factors Churn and writes cleaned_churn_data.csv
02_eda.R ggplot2 charts: churn distribution and churn rate by contract type
03_feature_engineering.R Bins tenure into groups (0-1yr, 1-2yr, 2-4yr, 4-6yr) and writes final_churn_data.csv
04_modeling.R Logistic regression (Churn ~ tenure + MonthlyCharges + Contract, caret), 0.5 threshold, prints accuracy

churn_analysis.Rmd knits the full analysis into a single HTML report.

Key Insights

  • Month-to-month contracts show the highest churn.
  • Early-tenure customers are most at risk.

Model

Logistic regression. Accuracy: ~80%.

Business Recommendations

  • Incentivize long-term contracts.
  • Improve first-year customer onboarding.

Tools

R, dplyr, ggplot2, caret.

License

MIT. See LICENSE.

About

Analyzed customer churn for a telecom company using R. Performed data cleaning, exploratory analysis, and feature engineering to identify key churn drivers. Built a logistic regression model to predict high-risk customers (~80% accuracy) and provided actionable retention strategies.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages