Skip to content

Churn early warning

Which customers are about to leave, and how would you keep a churn model honest once it is in use?

Capstone 3~70 minadvanced Customers (simulated)

The story

A subscription business keeps a small customer table: age, annual income, months as a customer, plan, region, sign-up date, recent visits, and whether the customer churned. The retention team can call a limited number of customers each week, and a call costs far less than a lost customer. They want an early-warning list, and they want to know when to stop trusting it.

The work does not stop at a leaderboard. You will check the columns for anything that would leak the answer, train a model against a baseline, pick the threshold that costs least for this team, register the model so its predictions are reproducible, score data with it, compare that data with what it was trained on, set up a monitor, and give the team a dashboard. The data are simulated, so nothing here describes real people.

Data: Customers (simulated) · Simulated. CodeSplash parity fixture g1_customers (simulated, seed 20261103).

Stage 1 · insights · ~9 min

Hunt for leaks

A column that is only known after a customer leaves would make any model look brilliant and be useless in practice. Profile the table and ask of every column: would I know this before the customer churned?

Is any column recorded after, or because of, churning?

  1. Open Insights and choose customers (sample) in the picker.
  2. Read the findings, then open churned from the column list to see the base rate.
  3. Go through the columns one by one. Would each be known before a customer leaves?Leaks are found by thinking about when each value is recorded, not by a test.

Stage 2 · model · ~20 min

Train against a baseline

Set up the prediction problem, keep the suggested validation plan, and train a baseline beside a random forest. The forest is only worth deploying if it beats the baseline by more than the folds vary.

How much better than the baseline is the forest, measured on folds it did not train on?

  1. Open Predict in the sidebar.
  2. Press New experiment, choose customers (sample) and press Create.
  3. Set Target to churned.
  4. Press Continue on Setup, keep the suggested validation plan, and press Continue again.
  5. Select Baseline (no features) and Random forest.
  6. Press Train.
  7. Read the leaderboard. Is the forest's lead bigger than the noise between folds?

Stage 3 · model · ~9 min

Choose the threshold by cost

The model gives each customer a score; the team needs a yes or no. The right cutoff depends on what each mistake costs: a wasted call is cheap, a missed churner is expensive. Put those costs in and let them choose the threshold.

Which threshold costs the team least, and how many customers would they call at it?

  1. Open the top model on the leaderboard.
  2. Open the Evaluation tab.
  3. Fill in the costs of a false positive and a false negative, then set Threshold to the value that costs least.A threshold of 0.5 is a default, not a decision. The cheapest cutoff follows the ratio of the two costs.

Stage 4 · models · ~18 min

Register, score and watch

Registering freezes the fitted model and its preprocessing as a version. Score data with it, compare that data with the training rows for drift, and set up a monitor that repeats the check on a schedule.

What would make you stop trusting this model, and how would you find out?

  1. On the model's run page, press Register.
  2. Give it a name and press Register.CodeSplash checks that scoring reproduces the training predictions, so the version means what it says.
  3. Open Models in the sidebar and choose your model.
  4. Open Score data and press Score.
  5. Open Drift and press Compare.
  6. Open Monitor & serve, press the + button (New monitor), choose the dataset to watch, and press Save monitor.A monitor turns one check into a schedule that tells you when to look again.

Stage 5 · dashboards · ~15 min

Give the team a dashboard

The retention team will not open a run page. Give them one page with the churn rate and a chart they can filter, built on the customer data.

  1. Open Dashboards, press the plus button and choose Blank dashboard.
  2. Press Add a data source, choose customers (sample) and press Add source.
  3. Close the Data sources dialog, press KPI and set its measure to the mean of churned.
  4. Press Add widget, choose Chart, and set it up to show churn by plan or by tenure.
  5. Press Present to see the page the way the team will.
Hints
  • Ask of every column when it is recorded. Anything recorded because a customer left is a leak.
  • In Evaluation, the cost fields turn the threshold into a business decision rather than a default of 0.5.
  • Drift tells you the data have moved, not that the model has got worse. The monitor is how you find out in time.

dashboard

A churn dashboard and a monitoring plan

Describe the early-warning system you built: the model and how it compares with the baseline, the threshold and why, what the team should do with the list, and how the monitor will tell you when to retrain.

  1. Model and baseline
  2. Threshold and costs
  3. What the team does with the list
  4. Monitoring and when to retrain
Rubric
CriterionPoints
Explains how each column was checked for leakage.1
Reports the model's lead over the baseline, measured on held-out folds.2
Chooses the threshold from stated costs and gives the resulting trade-off.2
Names what the monitor watches and what would trigger a retrain.2
Notes that the data are simulated and the costs are assumptions.1

Model answer

Show the model answer

Model and baseline. No column is recorded after churning; visits and tenure describe the customer up to the snapshot. The random forest beats the baseline on held-out folds; report the size of the lead next to the fold-to-fold spread from your leaderboard rather than a single score.

Threshold. With a call costing 1 and a lost customer 10, the cheapest threshold sits well below 0.5 (for calibrated probabilities, near 1 / (1 + 10), about 0.09): the team should accept many wasted calls to catch more churners. State the threshold you chose and the share of customers it flags, because that number has to match the team's weekly capacity.

Using the list. Call customers above the threshold, highest scores first. The score ranks who to call; it does not say why a customer is leaving.

Monitoring. The model is registered, so its scores are reproducible. Scoring the training data and comparing it with itself should show no drift, and is a check of the setup. The monitor repeats that comparison on new data; a drift alert means the inputs have moved and the model should be re-checked against recent outcomes before anyone retrains it. The data here are simulated and the costs are assumptions to revisit with the team.