Built to order

Customer Churn Prediction using Machine Learning

A telecom-style churn predictor that flags customers likely to cancel using XGBoost on usage, billing and support-ticket features. The dashboard shows churn-risk segments, top churn reasons and what-if retention simulations — a business-analytics project recruiters instantly understand.

Cover thumbnail image for the Customer Churn Prediction using Machine Learning project.
More project photos (2)

The problem

Customer Churn Prediction using Machine Learning is a business-analytics final year project that flags which customers are likely to cancel, why they are leaving, and what retention actions could change the outcome. Built on telecom-style customer records (tenure, monthly charges, contract type, support tickets, subscribed services), an XGBoost classifier learns churn patterns while class-imbalance techniques keep the minority churn class from being ignored. Everything is served through a Streamlit dashboard branded ChurnGuard: churn-risk segments, SHAP-ranked churn drivers, revenue-at-risk summaries and a what-if simulator that shows how a retention offer moves an individual customer's risk score. Because churn analytics maps directly to real industry roles, this is a project recruiters — and viva examiners — instantly understand.

This is a built-to-order project: the code, trained models, report, PPT and viva Q&A are prepared and quality-checked for your order.

How it works

  1. Telecom-style customer records are loaded and cleaned: contract types encoded, charges scaled, tenure binned, missing values imputed.
  2. The data is split with stratification so the churn minority keeps its share in train and test sets.
  3. An XGBoost classifier is trained with scale_pos_weight set from the class ratio, then tuned (max_depth, learning_rate, min_child_weight) via cross-validation.
  4. The decision threshold is tuned on the validation set to favour recall on churners — missing a churner costs more than a false alarm.
  5. SHAP values explain every prediction; the ChurnGuard dashboard turns scores, segments, drivers and what-if simulations into an interactive retention tool.

Project features

  • Per-customer churn probability scoring with adjustable decision threshold
  • Risk segmentation (high / medium / low) with customer counts and revenue-at-risk rollups
  • SHAP-ranked churn drivers — e.g. month-to-month contract, short tenure, high monthly charges, frequent support tickets
  • What-if retention simulator: change contract type, tenure or support-call count and watch the risk score move
  • Class-imbalance handling: scale_pos_weight, stratified splits, optional SMOTE — compared explicitly in the notebook
  • Proper classification metrics: precision, recall, F1, ROC-AUC and PR curves, with threshold tuning aimed at churn-class recall
  • Streamlit dashboard (ChurnGuard) with filters by segment, contract type and tenure band
  • Retention-action mapping: each top driver links to a suggested business action (contract upgrade offer, proactive support call)

What is included

  • Full source code (training notebooks + Streamlit dashboard, well-commented)
  • Trained model files (.pkl) — the dashboard runs without retraining
  • Project report PDF (synopsis, literature survey, methodology, results, conclusion, business interpretation)
  • PPT presentation for the final review
  • Viva Q&A preparation document (imbalance handling, XGBoost internals, SHAP, precision-recall trade-offs)
  • Setup guide (environment, dependencies, running the dashboard locally)

FAQs

  1. Why not just report accuracy for this churn prediction project? With ~70%+ non-churners, a model predicting "nobody churns" scores 70% accuracy while being useless. The project optimizes and reports precision, recall, F1 and ROC-AUC instead — and the viva Q&A arms you to explain exactly why accuracy misleads on imbalanced data.
  2. How is class imbalance handled — SMOTE or scale_pos_weight? Both are implemented and compared: scale_pos_weight (cheap, no synthetic data) versus SMOTE oversampling. You can present the trade-off table in your review — examiners love this question.
  3. What does SHAP add beyond feature importance? Built-in importance says which features matter globally; SHAP explains individual predictions — why this customer is high-risk — which powers the what-if simulator and the retention-action mapping.
  4. How is the decision threshold chosen? By scanning thresholds on the validation set and picking the point that maximizes churn-class recall subject to an acceptable precision floor, since a missed churner costs more than an unnecessary retention call.
  5. Can I run the dashboard offline for my review? Yes — trained models ship as .pkl files and Streamlit runs locally, so the full demo works without internet.
  6. What extensions impress examiners? Cohort analysis (churn by tenure band over time), a cost-based threshold optimizer using real retention-offer costs, or survival analysis for when a customer will churn. Ask us to scope any of these.

Limitations & prerequisites

  • The model finds correlational churn drivers, not proven causes — a retention offer's true effect needs an A/B test, which the what-if simulator approximates, not guarantees.
  • Demo data is telecom-style; results on a real company's data would differ in feature mix and churn base rate.
  • Churn behaviour drifts (new plans, competitors), so the model needs periodic retraining on fresh data.
  • Revenue-at-risk figures are illustrative estimates from charges in the dataset, not audited financials.
Components & software requirements
  • Python 3, pandas, NumPy for data wrangling
  • scikit-learn: stratified splits, pipelines, precision/recall/F1, ROC and PR curves
  • XGBoost (XGBClassifier) with scale_pos_weight for imbalance
  • imbalanced-learn (SMOTE) for oversampling comparison
  • SHAP for global and per-customer explanations
  • Streamlit for the ChurnGuard dashboard
  • Matplotlib / Plotly for EDA and dashboard charts
Parameter Value
Problem type Binary classification (churn / no-churn)
Dataset Telecom-style customer records: tenure, monthly/total charges, contract, support tickets, services
Class balance Typically ~25–30% churners; handled with scale_pos_weight / SMOTE + stratified splitting
Primary model XGBoost classifier, tuned via cross-validation (max_depth, learning_rate, min_child_weight, scale_pos_weight)
Threshold strategy Tuned for churn-class recall (missing a churner is costlier than a false alarm)
Metrics Precision, Recall, F1, ROC-AUC, PR-AUC — reported from the actual training run
Explainability SHAP summary plots + per-customer contribution breakdowns
Dashboard Streamlit (ChurnGuard): segments, drivers, revenue at risk, what-if simulator

Download abstract (PDF)

Related guides

All guides
Illustration of JWT authentication: a brass key handing a glowing sealed token to a server rack and a laptop login screen, linked by a chain motif.B.E./B.Tech Computer Science and IT students adding login and protected APIs to their final-year web projects

JWT Authentication for Students: Tokens, Signatures, Refresh Flows and a Node.js Implementation

How does JWT login actually work? When a user logs in, the server issues a signed token in three parts — header, payload, signature. The client sends it back as an Authorization: Bearer header, and the server verifies the signature instead of looking up a session. This guide decodes a real token by hand, walks through the full login and refresh flow, and builds a working Node.js implementation with bcrypt password hashing, token rotation, and storage rules that survive a viva.

Read guide
Illustration of SQL versus NoSQL: neat filing-cabinet table rows on one side against flexible nested document cards on the other, joined by dotted lines.B.E./B.Tech Computer Science and IT students choosing and designing the database for their final-year project

SQL vs NoSQL for Final-Year Projects: Which Database Should You Pick?

MySQL or MongoDB for your final-year project? SQL databases store data in related tables with enforced schemas, joins and transactions — the right default when your data is structured and money or records must stay consistent. NoSQL document stores trade the rigid schema for flexible, nested documents that ship faster when your data shape keeps changing. This guide compares them with a worked hospital-appointment example in both, a decision table, and rules matched to common project archetypes.

Read guide
Editorial illustration of shipping containers transforming into glowing software windows beside a laptop showing container layers, in blue and teal tones.B.E./B.Tech Computer Science and IT final-year students shipping web/backend projects

Docker for Student Projects: Images, Containers and Compose from Zero

End ‘it works on my machine’ failures: learn what Docker images and containers actually are, write lean Dockerfiles that exploit layer caching, persist data with volumes, orchestrate app-plus-database with Compose, and package an evaluator-proof submission — with the debugging table for every error you will definitely meet.

Read guide
Get a quotation