ProjectTelecommunications

Customer Churn Prediction

A complete end-to-end ML case study for a telecom company. From raw data to a deployed API — covering EDA, feature engineering, model selection, cross-validation, hyperparameter tuning and business impact analysis.

Pythonscikit-learnXGBoostFastAPI1 November 2025

Executive Summary

Customer churn is one of the most critical metrics for telecom operators. In this case study, we outline the design, development, and deployment of a machine learning system to predict high-risk churn customers.

By deploying this model, the client was able to target retention campaigns proactively, reducing churn by 14% over a 6-month pilot.

Business Problem

Acquiring a new customer costs 5 to 25 times more than retaining an existing one. The customer retention team needs to know:

  1. Who is likely to leave?
  2. Why are they leaving?
  3. What retention offers will be most effective?

Dataset & Exploratory Data Analysis

We analysed historical logs of 7,043 customers with 21 features, including demographic information, account settings, services usage, and monthly charges.

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

df = pd.read_csv('telecom_churn.csv')
print(df.info())

Model Selection

We benchmarked three classification models:

  • Logistic Regression (baseline)
  • Random Forest
  • XGBoost

XGBoost achieved the highest validation ROC-AUC score of 0.84.