Monitoring models and drift

ExplainedMLOpsDevOps, Hands OnBy Cloud Hands On

Why models get worse without anyone touching them, and how to notice before your users do.

A model is a snapshot of the world when its data was collected. Data drift is when inputs change (longer deliveries, a new country). Concept drift is when the link between inputs and the answer changes (a new courier, a new law). Either can make a model quietly wrong.

Watch three things: the inputs (drift scores such as PSI, missing values), the outputs (the share of high-risk predictions), and, once real outcomes are known, the results (AUC or error on recent labelled data). Input drift is an early warning; only results prove the model is worse.

When drift appears, retrain on recent data, compare challenger and champion on recent holdout data, and promote only on evidence. Some drift doesn't hurt at all, and some harm shows no input drift, which is why results matter most.

Cost. Free: drift checks are a few lines of code.

Use it when

How it works

Inputs
PSI per feature against the training data.
Outputs
Share of each prediction over time.
Results
Scores on recent labelled data.
Act
Retrain, compare, promote or keep.

Options

Scheduled checks
A nightly or weekly job with alerts.
Monitoring tools
Evidently, Azure ML model monitoring and similar.
Manual reviews
Better than nothing, but easy to skip.

Example. Fernhill Cloud's ticket-routing model drifted when a new product launched: PSI on the product field reached 0.7 and the share of tickets routed to 'other' doubled. Retraining on two weeks of new tickets restored routing accuracy.

Don't confuse it with

Data drift
The inputs look different.
Concept drift
The same inputs now lead to different answers.

Words to know

PSI
Population stability index: how far a feature's spread has moved.
Data drift
Inputs change.
Concept drift
The meaning of the inputs changes.

Where to look

  1. drift.py
  2. promote.py --holdout

Practise it

Read it in the guide, next to the tasks and labs.

Open in DevOps, Hands On

Keep going