Checking the Model After It Meets New Data
Inputs, outcomes, and service behaviour can change after launch. Monitor each separately and keep a tested route back to a known compatible version.
14 sections · 4 questions · 2 coding challenges
The arrow keys move between sections too.
Testing a System That Keeps Receiving New Data
BOTIE
Our small monitoring examples distinguish a changed input distribution from an observed increase in prediction error. Neither should be mistaken for the other.
Sources for this history
What Should Botie Watch Once the Model Is Running?
A model passed its release checks, but the new season brings different temperatures and a changed sensor firmware. The service still returns numbers quickly. That does not tell us whether they remain useful.
We need to look beyond whether the service responds. Are the inputs still valid and familiar? Once outcomes arrive, are the predictions still useful? Service failures and delays need their own checks. For each signal, decide what evidence we would inspect and what response it could justify.
The monitoring records are invented, with predictions and later outcomes already aligned.
Step 1 of 3
Watch the inputs
A change can appear before labels are available.
Reference mean
Values: 20
Recent mean
Values: 25
Step 2 of 3
Wait for aligned outcomes
Prediction quality needs the matching eventual observations.
| Matching record | Predictions | Later outcomes | Absolute errors |
|---|---|---|---|
| Prediction 1 | 10 | 11 | 1 |
| Prediction 2 | 12 | 15 | 3 |
Prediction 1
- Predictions
- 10
- Later outcomes
- 11
- Absolute errors
- 1
Prediction 2
- Predictions
- 12
- Later outcomes
- 15
- Absolute errors
- 3
Step 3 of 3
Choose a response
A signal initiates a defined check, not blind retraining.
- Possible action
- inspect schema, version, and subgroup errors
Monitoring becomes an error measurement when the answers arrive
Outcome-based monitoring measures an error that input drift alone cannot establish.
What do the outcomes tell us after prediction?
Input changes alone do not reveal whether predictions became worse. Match the later outcomes to the saved predictions and measure their errors on the same records.
BOTIE
Mean absolute error on the matched outcomes
2
Follow the operations
1. Recorded predictions
- 010
- 112
2. Matched later outcomes
- 011
- 115
3. Subtract
- 0-1
- 1-3
4. Absolute value
- 01
- 13
5. Mean
2
6. Result
2
Labels must be correctly matched and representative. Report window size, model version, and subgroup results.
1. Separate Four Monitoring Questions
Validate input contracts first. Then inspect feature and prediction distributions, track outcome-based quality as labels become available, and measure service latency and failures. These monitors answer different questions.
A unit conversion can change input values while leaving requests syntactically valid. A latency spike can occur even when predictions remain accurate. Preserve enough context to distinguish them.
Give each alert a reason, owner or review route, and useful diagnostic evidence.
2. Compare Like With Like
Choose reference and recent windows with comparable operating modes. Seasonal shifts may be expected, while a sudden missingness change after a firmware update may indicate a pipeline failure.
A difference in means is a simple signal, not a complete distribution test. It can miss changes in spread or subgroup composition. Set thresholds using expected variation and investigation costs.
Reference mean = 20
Recent mean = 25
Mean shift = 5Distribution drift is not by itself evidence that prediction error increased.
3. Join Predictions to Delayed Labels
Store stable identifiers, timestamps, and model versions so later outcomes can be matched to the predictions that preceded them. Avoid using an outcome that was already known at prediction time as an independent evaluation.
Calculate errors by time window and relevant subgroup. Label delays and selective feedback can bias a dashboard toward easy-to-observe cases.
The exercise uses already aligned predictions and outcomes; the join remains a real system responsibility.
Join the later answers to the earlier predictions
These arrays have already been aligned by record identity. Inspect each absolute error before reporting their average.
import numpy as np
predicted = np.array([7., 8., 9.])
observed = np.array([6., 8., 11.])
errors = np.abs(predicted - observed)
print(errors.tolist())
print(float(errors.mean()))[1.0, 0.0, 2.0]
1.0The average describes these three matched outcomes. It does not reveal which subgroup is doing poorly, so the later challenge asks for that separation.
4. Respond and Roll Back as a Whole Procedure
If requests violate the input contract, follow the service's rejection or quarantine policy. If a new release makes predictions worse, restore a compatible earlier procedure and check it on the saved fixtures.
Retraining will not fix every change. A unit-conversion bug, for example, may affect the new training data too. Record what went wrong, keep the relevant artifacts, and verify the repair before promoting another version.
Botie’s workshop calculates observed error against later outcomes rather than treating drift as an accuracy label.
5. Separate Service Health from Prediction Quality
Latency, error rates and resource use tell us whether the service operates. Input distributions and missingness tell us whether the records changed. Outcome-based metrics tell us whether predictions remain useful once labels arrive.
Give each signal a reference period and a response owner. A spike in request failures calls for a different investigation from a gradual rise in forecast error. One dashboard number cannot distinguish these causes.
6. Match Later Outcomes to the Prediction That Was Actually Issued
Retain the prediction, issue time and model version under a stable request or event identifier. When an outcome arrives, join it to that stored prediction. Recomputing with today's model answers a different question.
Do not treat unresolved outcomes as negative labels. Track label coverage and delay so the reported score's population is visible.
Score only outcomes that have arrived
Prediction b remains unresolved and is excluded from this score, while its missing status is reported.
import numpy as np
prediction = {'a': 10., 'b': 20., 'c': 30.}
observed = {'a': 12., 'c': 27.}
matched = sorted(set(prediction) & set(observed))
error = [abs(prediction[k]-observed[k]) for k in matched]
print(matched)
print(float(np.mean(error)))
print(len(matched), len(prediction))['a', 'c']
2.5
2 3The error describes two resolved predictions. If difficult cases take longer to label, that partial score can be biased.
7. Observe a Candidate before Giving It Every Decision
A shadow run produces candidate predictions beside the active model without letting the candidate control the decision. It can reveal input-contract, latency and prediction disagreements before a rollout.
A limited rollout then exposes the candidate to a declared share of eligible traffic. Keep assignment and outcomes so comparisons remain meaningful. Shadow predictions alone cannot measure how users respond to decisions the candidate never actually made.
8. Rehearse the Return to a Known Version
Define the signals that trigger review or rollback, the person or process authorised to act, and the earlier compatible release. Test switching the full artifact and preprocessing together, then verify preserved fixtures and service health.
Record why the change occurred and which requests used each version. Rollback limits exposure to a suspected regression; it does not guarantee the earlier model is suitable after a genuine population change. Continue the investigation after service is restored.
Check yourself
Questions on Parts 1 to 8
Question 1 of 4
What can be concluded directly?
Use the information below.
Input mean changes, but no new outcome labels are available.Try it with Botie
Build with Botie
Write and run Python