The problem
Telecom operators lose revenue when subscribers leave, yet most students who attempt "churn prediction" stop at a Jupyter notebook that predicts a label and never explains why. The real business value is in understanding which customers are at risk and which factors push them out — contract type, tenure, monthly charges, fiber-optic plans, electronic-check payments — so retention offers can be targeted instead of sprayed. This project takes the IBM Telco Customer Churn dataset (7,043 customers, 20 mixed-type predictors, a genuinely imbalanced 26.5% churn rate) through the complete ML pipeline: cleaning and one-hot encoding, a stratified train-validation-test split, XGBoost training with early stopping on validation AUC, and a single honest evaluation on the held-out test set. A working web demo makes the model tangible: enter a customer profile and watch the churn probability with the top contributing factors, alongside a dataset explorer and a model lab that documents hyperparameters and design-target metrics. The report explains every decision for a confident viva.
Student who trains the model and runs the scoring demo.
Follow the working sequence
How it works
- The IBM Telco Customer Churn CSV is loaded and inspected: 7,043 rows, 21 columns, dtypes and missing values checked (TotalCharges arrives with blank strings for zero-tenure customers).
- Preprocessing coerces TotalCharges to numeric, one-hot encodes the categoricals and scales the numerics, producing the 20-predictor feature matrix.
- A stratified 70% train / 15% validation / 15% test split preserves the 26.5% churn rate in every partition.
- XGBoost trains with early stopping on validation AUC (reference: 300 trees, max depth 5, learning rate 0.05, scale_pos_weight ~2.77 for the class imbalance).
- The held-out test set is evaluated exactly once: accuracy, precision, recall, F1, ROC-AUC and the confusion matrix — the report records what the run actually achieved.
- In the web demo, a customer profile is scored and the top contributing factors are displayed as signed bars, so the "why" behind each prediction is visible.
Tech stack:
- Python 3, XGBoost, scikit-learn
- Pandas, NumPy (data processing)
- Matplotlib (training curves, confusion matrix)
- Jupyter Notebook (training & evaluation)
- HTML5, CSS, JavaScript (churn-scoring web demo)
- IBM Telco Customer Churn dataset (Kaggle)
Dataset & model details
- Dataset: IBM Telco Customer Churn — 7,043 customer rows, 21 columns (20 predictors + Churn label), binary classes (Yes/No), churn rate 26.5% (1,869 churners), publicly available on Kaggle.
- Task: Binary classification; input = 20-attribute customer vector (demographics, services, account), output = churn probability in [0, 1] plus the Yes/No label.
- Model: XGBoost gradient-boosted tree classifier (reference hyperparameters: n_estimators 300, max_depth 5, learning_rate 0.05, subsample/colsample_bytree 0.8, scale_pos_weight ~2.77, early stopping 30 rounds on validation AUC).
- Metrics: Accuracy, precision, recall, F1-score and ROC-AUC on a stratified 15% held-out test set — design targets 0.82 / 0.78 / 0.74 / 0.76 / 0.86. No figure is claimed as measured until the built-to-order training run is executed; the delivered report records the actual achieved values.
| Parameter | Value |
|---|---|
| Dataset | IBM Telco Customer Churn, 7,043 rows, 21 columns |
| Classes | 2 (Churn: Yes / No), 26.5% positive rate |
| Model | XGBoost gradient-boosted trees (design target) |
| Test accuracy | 0.82 (design target, not a measured claim) |
| ROC-AUC | 0.86 (design target, not a measured claim) |
| Split | 70% train / 15% validation / 15% test, stratified |
| Demo | Single-file web app; client-side scoring approximation |
| Trained model export | Approximately 1–3 MB serialized booster (expected) |
| Training time | Approximately 5–15 min on a laptop CPU (expected) |
Project features
- [XGBoost churn classifier] Gradient-boosted decision trees trained on the IBM Telco Customer Churn dataset, outputting a calibrated churn probability plus the binary Yes/No label for each customer.
- [Churn-risk scoring demo] Enter all 20 customer attributes (demographics, services, account details) and receive the churn probability with the top six contributing factors shown as signed contribution bars.
- [Dataset explorer dashboard] Full dataset context: 7,043-row statistics, the 73.5/26.5 class split, typical XGBoost feature-importance ranking, sample customer records and the complete feature catalogue.
- [Model lab] Documented reference hyperparameters, evaluation metrics stated as design targets, a confusion-matrix illustration of the expected held-out outcome, and the complete training pipeline in six steps.
- [Retention playbook analysis] A simulated offer-response view showing which levers (contract upgrade, adding tech support, payment method) move a high-risk profile's score — presented as an illustrative analysis, not a business guarantee.
- [Training & evaluation notebook] Data cleaning (TotalCharges coercion for zero-tenure rows), one-hot encoding, scaling, stratified 70/15/15 split, XGBoost with early stopping, and one held-out test evaluation.
- [Threshold tuning] Validation-based decision-threshold adjustment documented in the notebook, with the recall-vs-precision tradeoff explained for the viva.
What is included
- Complete training & evaluation Jupyter notebook
- Trained XGBoost model with the preprocessing pipeline
- Churn-risk scoring web demo (single-file HTML/CSS/JS)
- Dataset explorer + model lab dashboards
- Confusion matrix, per-class metrics and training-curve plots
- Project report PDF (background, dataset analysis, model rationale, methodology, results)
- PPT presentation for final review
- Viva Q&A preparation document (gradient boosting, overfitting, class imbalance, metrics tradeoffs)
Limitations & prerequisites
- The 0.82 accuracy / 0.86 AUC figures are design targets for the training run, stated honestly — the report documents the metrics the run actually achieves.
- The in-browser demo scorer is a hand-calibrated logistic approximation of the XGBoost model, built to mirror its learned patterns; it is not the trained classifier and must not drive real business decisions.
- The public IBM dataset is a snapshot with synthetic-feeling distributions — it does not represent any real operator's customer base, and a deployed model would need fresh, representative data.
- Churn drivers are correlational, not causal: moving a customer to a two-year contract in the demo does not prove the contract itself retains them.
- Customer behavior drifts over time, so a model trained on this snapshot would need periodic retraining in production — outside this project's scope.
Frequently Asked Questions
Which dataset is used and why?
The IBM Telco Customer Churn dataset, public on Kaggle: 7,043 customers, 20 predictors (demographics, services, account) and a binary churn label at a 26.5% positive rate. It is the standard tabular benchmark for churn modeling, small enough to train on a laptop and well-documented for viva questions.
Which model is used and why XGBoost?
XGBoost — gradient-boosted decision trees. Tabular mixed-type data with non-linear interactions (fiber + month-to-month + electronic check jointly raising risk) is exactly where boosted trees beat linear models, and the project documents the hyperparameter reasoning.
Is the 0.82 accuracy guaranteed?
No. It is the development target for the built-to-order training run. The delivered report records the accuracy, precision, recall, F1 and ROC-AUC the training run actually achieved — nothing is claimed as measured before that run.
How does the demo's churn score work?
The demo page runs a hand-calibrated logistic approximation of the XGBoost model in JavaScript so it works offline in one file. It mirrors the trained model's learned patterns (e.g. short tenure and month-to-month contracts raise risk); the real trained model is delivered as the Python artifact.
Can it be trained on a custom dataset?
Yes. The notebook's preprocessing, encoding and training steps are parameterized, so a different customer CSV with the same style of columns can be swapped in as a customization — the report then documents the new dataset's own metrics.
Is this project suitable for a final-year project?
Yes — for Computer Science, IT and AI/ML programs. It demonstrates the full supervised-learning pipeline: dataset analysis, preprocessing, gradient-boosted modeling, honest evaluation and an interpretable deployment demo. Suitable for B.E./B.Tech final-year projects in Computer Science, IT and AI & Machine Learning.
Components & software requirements
- Python 3, XGBoost, scikit-learn
- Pandas, NumPy (data processing)
- Matplotlib (training curves, confusion matrix)
- Jupyter Notebook (training & evaluation)
- HTML5, CSS, JavaScript (churn-scoring web demo)
- IBM Telco Customer Churn dataset (Kaggle)
Dataset & model details
- Dataset: IBM Telco Customer Churn — 7,043 customer rows, 21 columns (20 predictors + Churn label), binary classes (Yes/No), churn rate 26.5% (1,869 churners), publicly available on Kaggle.
- Task: Binary classification; input = 20-attribute customer vector (demographics, services, account), output = churn probability in [0, 1] plus the Yes/No label.
- Model: XGBoost gradient-boosted tree classifier (reference hyperparameters: n_estimators 300, max_depth 5, learning_rate 0.05, subsample/colsample_bytree 0.8, scale_pos_weight ~2.77, early stopping 30 rounds on validation AUC).
- Metrics: Accuracy, precision, recall, F1-score and ROC-AUC on a stratified 15% held-out test set — design targets 0.82 / 0.78 / 0.74 / 0.76 / 0.86. No figure is claimed as measured until the built-to-order training run is executed; the delivered report records the actual achieved values.
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.