A customer churn prediction and retention ROI model built on IBM Telco data. Predicts which customers are likely to leave, ranks them by risk, and calculates the net revenue value of a targeted retention campaign (i.e recommends the interventions worth paying for).
Headline result: Targeting 601 flagged customers is estimated to generate $63,024 in net retained revenue at 699% ROI.
- Problem Framing
- What This Project Does
- Stakeholders
- Data
- Modelling approach
- Results
- Cost-benefit analysis
- Limitations
- Getting Started
- Tech Stack
- Author/Contributors
- License
Most businesses only know a customer churned after it happened, that is, when it's too late. This project predicts churn 30–60 days in advance using behavioural signals, so retention teams can act before revenue walks out the door.
Churn prediction is a binary classification problem. The target variable is whether a customer churned (1) or stayed (0). The dataset is imbalanced — 26.5% churned, 73.5% stayed — which shapes all modelling decisions.
Recall was chosen as the primary evaluation metric over accuracy. A missed churner costs ~$65/month in lost revenue; a false alarm costs ~$15 in an unnecessary retention offer. The asymmetry justifies optimising for recall.
| Layer | Output |
|---|---|
| Prediction | Churn probability score per customer |
| Prioritisation | Ranked list of at-risk customers |
| Cost-benefit | Which interventions are actually profitable to run |
| Business brief | Revenue at risk, churn segments, recommended actions |
| Role | How They Benefit |
|---|---|
| Marketing team | Concentrate spend on highest-value interventions. |
| Customer success | Shift from reactive to proactive outreach. |
| Business analysts | Tie model performance to measurable revenue saved. |
- IBM Telco Customer Churn dataset via Kaggle
- Size: 7,043 rows × 21 columns
- Target:
Churn(Yes/No became 1/0) - Cleaning:
TotalChargescol. converted from string to float (11 nulls filled with 0),customerIDdropped, binary columns mapped to 1/0, 10 multi-category columns one-hot encoded.- Final shape: 7,043 rows × 30 columns.
| Feature | Description |
|---|---|
tenure |
Months as a customer |
contract_type |
Month-to-month, one year, two year |
monthly_charges |
Monthly bill amount |
support_calls |
Number of support interactions |
services_used |
Add-ons and products subscribed to |
churn |
Target label (Yes / No) |
Three models were trained and evaluated:
| Model | Rationale |
|---|---|
| Logistic Regression | Interpretable baseline; performs well on linear relationships |
| Random Forest | Ensemble method; tests non-linear pattern detection |
| XGBoost | Sequential boosting; strong on tabular data with imbalance |
Evaluation included classification report, confusion matrix, ROC-AUC curve, and precision-recall curve. Threshold tuning was applied across 0.10–0.55 to find the optimal business tradeoff between precision and recall.
| Model | Threshold | Recall | Precision | F1 | AUC |
|---|---|---|---|---|---|
| Logistic Regression | 0.30 | 0.757 | 0.523 | 0.619 | 0.84 |
| Random Forest | 0.25 | 0.807 | 0.513 | 0.627 | 0.82 |
| XGBoost | 0.25 | 0.826 | 0.514 | 0.630 | 0.84 |
Selected model: XGBoost at threshold 0.25.
XGBoost achieved the highest recall (0.826), best F1 (0.630), and highest average precision (0.66) on the precision-recall curve. Threshold tuning reduced missed churners from 199 to 65, which is a 67% reduction.
Top churn drivers (XGBoost feature importance):
- Internet service: fiber optic
- Contract type: two year (protective)
- Contract type: one year (protective)
- Tenure
- Payment method: electronic check
Assumptions: $64.76 avg monthly revenue, $15 offer cost, 30% retention success rate, 12-month customer lifetime.
| Tier | Customers | Net Value | ROI |
|---|---|---|---|
| High risk (≥ 0.70) | 109 | $19,320 | 1,060% |
| Medium risk (0.50–0.70) | 213 | $21,936 | 806% |
| Low risk (0.25–0.50) | 279 | $21,768 | 491% |
| Total | 601 | $63,024 | 699% |
- Dataset represents a single US telecom provider so generalisation to other markets or business models requires validation.
- 7,043 rows is a small dataset; performance may shift with more data
- No call log, NPS, or usage frequency data available, thus, richer behavioural signals would likely improve recall further
- Retention success rate of 30% is an industry benchmark, not a measured conversion rate for this business.
- Cost-benefit figures are estimates; actual campaign ROI depends on real offer costs and customer lifetime data.
pip install pandas numpy matplotlib seaborn scikit-learn xgboost imbalanced-learn plotly joblibRun notebooks in order:
notebooks/data_exploration.ipynb: data overview and visualisation.notebooks/cleaning.ipynb: preprocessing and feature encoding.notebooks/modelling.ipynb: model training, evaluation, threshold tuning.notebooks/cost_benefit.ipynb: ROI analysis and recommendations export.
Outputs generated:
outputs/confusion_matrix_lr.pngoutputs/roc_curve.pngoutputs/precision_recall_curve.pngoutputs/feature_importance.pngoutputs/threshold_tuning.pngoutputs/roi_by_tier.pngoutputs/retention_recommendations.csvoutputs/xgb_churn_model.pkl
Models used: Logistic Regression · Random Forest · XGBoost
Evaluation: Confusion Matrix · Precision / Recall · ROC-AUC
- Distributed under the MIT License.
- See LICENSE for more information.
For full details, see the report in the repo titled Data Consultancy Report_TelcoX.pdf


