Problem
A telecom data scientist must predict which customers will leave so that marketing can launch a retention campaign in time. The further ahead the model looks, the easier it is for marketing to react, but the weaker the predictors become. Churners are a tiny share of customers, so the training set is extremely unbalanced.
Example from the article: churn is introduced through a case-interview question: predict a deadly cancer 1–3 months before routine diagnosis, from monthly blood tests.
Solution in brief
Treat every monthly snapshot of every customer as a training row. Label a row positive if the customer churns in the next 1–3 months, and negative otherwise. Add features that describe change over recent months and retrain every month.
Questions this case answers
- How to label historical snapshots of entities for predicting a rare event that must be flagged a fixed number of months before it happens
- How to validate a periodically retrained classifier on a rare, seasonal target without testing on the past
- How to build a labeled training set for churn prediction when marketing needs 1–3 months of warning?
- How to turn monthly customer snapshots or event streams into training rows for a churn model?
Tools and methods
- Labeling by prediction horizon — turns customer history into positive and negative rows
- Time-window features — rate of change, average, variance and threshold flags over recent months
- Weighted classification and undersampling — handle the rare positive class
- Tree ensembles (boosting) — suggested classifiers for tabular data of tens to hundreds of thousands of rows
- ROC AUC — metric for comparing models on unbalanced data
- BigQuery — example engine for the SQL joins on tens of millions of rows
Google or a one-time email code. No password.