Portfolio · CRISP-DM
Telco churn, propensity, and next-best-action
Which customers should a retention team contact, and with what offer? This repository builds a churn model, add-on propensity models, a CLV proxy, and a readable next-best-action rule table, served one customer at a time through a FastAPI POST /score endpoint. The training table is IBM Telco Customer Churn: 7043 rows and 21 columns, IBM's public US telco sample. The CSV has no country column. It is not Kenyan operator data.
0.846001ROC-AUC
0.656070PR-AUC
2.806733Top-decile lift
Gradient boosting, the served model, on the held-out test set of 1761 customers. Seed 42, stratified test size 0.250000. The top 10% by this score churn at 2.806733 times the base rate. Source: reports/metrics.json.
Logistic regression leads ROC-AUC on this split (0.846490). Gradient boosting leads PR-AUC (0.656070) and top-decile lift (2.806733). POST /score still serves gradient boosting, because config/nba_rules.yaml fixes scoring_model before the test table. Ranked by ROC-AUC: Logistic regression, Gradient boosting, Dummy prior.
| Model | ROC-AUC | PR-AUC | Top-decile lift |
|---|---|---|---|
| Dummy prior | 0.500000 | 0.265190 | 1.000000 |
| Logistic regression | 0.846490 | 0.638090 | 2.785308 |
| Gradient boosting (served) | 0.846001 | 0.656070 | 2.806733 |
Scroll sideways for the full table.
The live demo scores customers in the browser: the three committed requests, the held-out sample, or a CSV you choose. This page and the score desk keep the written briefing.
What one score returns
- Churn probability from the gradient boosting pipeline.
- Three path contributions. They sum with the intercept to the churn log-odds. They are not SHAP values.
- A CLV proxy: monthly charges times restricted mean remaining tenure.
- Add-on propensities for OnlineSecurity and TechSupport, which are current-holding lookalikes.
- A next-best action from the rule table: save call, offer, or no action.
Sample
- Dataset
- IBM Telco Customer Churn
- Rows
- 7043, of which 1869 have Churn = Yes (rate 0.265370)
- Split
- Seed 42, test size 0.250000, stratified on Churn. Train 5282, test 1761.
- Source
- https://raw.githubusercontent.com/IBM/telco-customer-churn-on-icp4d/master/data/Telco-Customer-Churn.csv
- SHA-256
- 16320c9c1ec72448db59aa0a26a0b95401046bef5d02fd3aeb906448e3055e91
- License note
- Apache-2.0 on the IBM repository covers that code pattern. The repository does not state a separate license for the CSV. This repo vendors the file unchanged.
Scope
- The metrics describe this public sample. They say nothing about any operator's customers.
- Uptake scores are probabilities of current holding, not of accepting an offer, and not uplift.
- The CLV proxy ignores margin, discounting, and whether a save call changes survival.
- The next-best-action table is a policy. It does not estimate the causal effect of a call or an offer.
- There is one stratified holdout and no hyperparameter search.