Sub topic 1
Why Production Models Need Retraining
Prerequisites
This chapter assumes you have trained a model with a train, validate, and test workflow. You should know basic Python and NumPy, and understand that a deployed model serves predictions from fixed learned weights.
Why production models need retraining
A model learns patterns from historical data. After deployment, the world keeps changing. Customer behavior shifts, sensors age, and fraud tactics evolve. The model still returns predictions, but they grow less accurate over time. This gradual loss of accuracy is called model decay.
Data drift, label drift, and concept drift
Drift is any change that makes live data differ from the training data. Three kinds matter:
- Data drift: the distribution of inputs changes. For example, more users shop on phones, so the
devicefeature shifts. - Label drift: the distribution of the target changes. For example, the fraud rate rises from 1% to 4%.
- Concept drift: the relationship between inputs and the target changes. For example, a discount that once signaled loyalty now signals bargain hunting.
Data drift can be detected without labels. Concept drift usually requires labels, so it is harder to catch.
The four families of retraining triggers
A trigger is the rule that starts a retraining run. The four families are:
- Schedule triggers: retrain at fixed intervals.
- Performance triggers: retrain when a measured metric falls below a threshold.
- Drift triggers: retrain when input or prediction distributions move away from the training baseline.
- Data-volume triggers: retrain when enough new labeled rows have accumulated.
What to monitor: inputs, predictions, and outcomes
Log three things for every batch of predictions:
- Inputs: feature values, compared against training statistics.
- Predictions: the score distribution, which often shifts before accuracy drops.
- Outcomes: the true labels, when they arrive.
Input and prediction signals are available right away. Outcome signals are the most reliable, but they often arrive late.
Schedule-based triggers
A schedule trigger retrains every N days, for example every Monday. It is simple to run and easy to audit. Its weakness is that it ignores the model's actual state. A stable model gets retrained for no reason, and a model that fails on Tuesday waits until the next run.
Use a schedule as a safety net, not as the only signal. A maximum model age, such as 30 days, ensures that no model runs unchecked for too long.
Performance triggers and the label delay problem
A performance trigger fires when a metric such as AUC or precision drops below a threshold. It measures what you care about, but it needs labels. For a loan default model, a label may take 90 days to appear. By the time the trigger fires, the model may have made thousands of poor decisions.
Label delay is the gap between a prediction and its known outcome. To handle it, pair the performance trigger with a drift trigger that needs no labels. Also compare performance only on rows whose labels are complete.
Exercise
A fraud model's labels arrive after 14 days. Which trigger should fire first when fraud patterns change, and why?
Show answer
A drift trigger. It uses only inputs and predictions, which are available immediately. A performance trigger would wait about 14 days for labels before it could detect the change.