Monitoring models and drift
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
- a model has been in use for months without checks.
- the business changed (new products, markets, suppliers).
- users say the model 'feels wrong'.
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
- drift.py
- promote.py --holdout
Practise it
- Spot drift in the data a model seesHow-to, Free
- Retrain and promote only when it's betterHow-to, Free
- Final project: a pipeline from data to scored ordersHow-to, Free
Read it in the guide, next to the tasks and labs.
Open in DevOps, Hands On