Project
Stage 2 project: Churn model for a business team
Everything from Stage 2 in one deliverable: a tuned, cross-validated pipeline, a capacity-based threshold, and a summary a non-ML stakeholder can act on.
Time: ~3–4 hours if you build it yourself (recommended). Run the reference version:
PYTHONPATH=tools .venv/bin/python stage-2-machine-learning/project-churn-model/churn_model.py
Core (build this)
- One leak-free
ColumnTransformerpipeline (Part 5), shared by every candidate model. - Tune at least two model families with
GridSearchCVon training data only (Part 8). - Pick the winner by cross-validated ROC-AUC; report its test ROC-AUC once.
- Turn probabilities into a call list sized to the team's capacity (Part 6).
- Print a three-line summary in business language — no metric jargon without translation.
Stretch
- Add permutation feature importance and a per-contract fairness check (Part 8's FNR table).
- Add calibration (
CalibratedClassifierCV) and verify predicted probabilities match observed rates.
Production level
- Write a model card: data used, metrics, limitations, intended use, groups checked.
- Save the fitted pipeline with metadata (versions, metrics) — Track B picks this up.
What "done" looks like
Output of the reference run:
logistic regression CV ROC-AUC 0.806 {'clf__C': 10.0}
gradient boosting CV ROC-AUC 0.794 {'clf__learning_rate': 0.05, 'clf__max_depth': 2}
chosen model: logistic regression (test ROC-AUC 0.811)
call-list threshold for 100 calls: 0.481
SUMMARY FOR THE RETENTION TEAM
- Each month we send you the 100 customers most likely to churn.
- About 59% of them are genuine churn risks; the list covers 49% of all churners.
- The model leans on contract type, tenure and support calls; customers on
month-to-month contracts with recent support calls are the highest risk.