Part IV — Expert Production Engineering · Chapter 20 · Lesson 4 of 7 · 6 min read
Lesson 4: Drift, Fairness Diagnostics, Alerting, and Acknowledgement
Lesson level: Expert
Purpose: Detect when the data, predictions, or outcomes of a live model move away from what it was validated on, check whether performance and decisions differ unacceptably across groups, and turn those signals into alerts that people acknowledge and act on.
Learning objectives
By the end of this lesson you will be able to:
- distinguish data drift, prediction drift, and concept drift
- measure distribution shift with the population stability index and related statistics
- choose reference windows and thresholds
- compute group-level performance and decision-rate diagnostics
- design alerts with severity, ownership, and acknowledgement
- document the outcome of every alert
4.1 Kinds of drift
| Drift | What changes | Visible when | Example |
|---|---|---|---|
| Data (covariate) drift | Distribution of inputs | Immediately | A new marketing channel brings younger customers |
| Prediction drift | Distribution of scores or decisions | Immediately | Share of customers flagged doubles |
| Concept drift | Relationship between inputs and outcome | Only after outcomes arrive | A competitor's offer changes why customers leave |
| Data quality issues | Missing values, unit changes, broken feeds | Immediately | Spend reported in thousands instead of units |
Data and prediction drift are early warnings; they say the model is now working on different data, not that it is wrong. Concept drift is what actually degrades accuracy, but it can only be confirmed with outcomes. Monitor all of them, and treat data-quality issues first, because they are the most common cause of sudden "drift".
4.2 Measuring distribution shift
The population stability index (PSI) compares the share of observations in each bin between a reference window (for example the validation data or the first month in production) and a current window:
PSI = Σ (current share − reference share) × ln(current share / reference share)
Worked example. A score is split into four equal-share bins in the reference period (25% each). This week the shares are 15%, 20%, 30%, and 35%. The bin contributions are about 0.0511, 0.0112, 0.0091, and 0.0336, giving PSI ≈ 0.105. Common rules of thumb treat values below 0.1 as stable, 0.1–0.25 as a moderate shift worth investigating, and above 0.25 as a major shift — but these are conventions, not laws; calibrate thresholds on your own history of normal week-to-week variation.
Bins with zero share make the formula undefined; add a small floor to every share. For categorical features, use categories as bins and keep an explicit "unknown" bin, whose growth is itself a signal (Chapter 19, Lesson 1). Alternatives include the Kolmogorov–Smirnov statistic for continuous features and the Jensen–Shannon distance, which is bounded and symmetric. Whatever the measure, compute it per feature, for the score, and for the decision rate.
4.3 Reference windows and thresholds
- Fixed reference: the validation period. Detects any change since approval, including slow drift.
- Rolling reference: the previous four weeks. Detects sudden changes but can hide slow drift.
- Use both: a rolling comparison for alerts and a fixed comparison for monthly governance review.
- Account for known seasonality: compare December with last December, or include a seasonal baseline (Chapter 18).
- Require persistence — for example two consecutive windows above threshold — to avoid alerting on noise.
4.4 Fairness diagnostics
A model can perform well on average and poorly, or differently, for particular groups. Fairness diagnostics compare metrics across groups that matter legally, ethically, or commercially — regions, age bands, channels, and, where lawful and appropriately governed, protected characteristics.
| Diagnostic | Compares across groups | Concern it reveals |
|---|---|---|
| Decision-rate ratio | Share receiving the favourable or unfavourable action | Some groups are flagged or approved far more often |
| Recall (true positive rate) gap | Share of actual positives found | The model misses cases in some groups |
| False positive rate gap | Share of negatives wrongly flagged | Some groups bear more unnecessary interventions |
| Calibration by group | Predicted versus observed rates | Probabilities mean different things for different groups |
Worked example. Churn recall is 0.70 in the reference group, 0.62 in group B, and 0.48 in group C. The ratios to the reference are about 0.886 and 0.686. A governance policy might require every group's ratio to stay above 0.8 and require investigation below that, so group C triggers a review even though overall recall looks healthy.
Fairness criteria can conflict: when base rates differ between groups, a model generally cannot equalize calibration, false positive rates, and decision rates at the same time. Choosing which criterion matters is a governance decision, documented in the model card (Lesson 5), not a purely technical one. Report group sizes and uncertainty; small groups produce noisy ratios. Restrict access to sensitive attributes used for diagnostics, and do not use them as model features unless that has been explicitly reviewed and permitted.
4.5 Alerts that get handled
An alert that nobody owns is noise. Each alert definition specifies:
- Condition: metric, threshold, window, and persistence rule.
- Severity: for example page immediately (integrity failure, error spike), ticket within a day (moderate drift), or review at the monthly governance meeting (slow drift, small fairness gap).
- Owner: a team or rotation, not an individual's inbox.
- Runbook link: first diagnostic steps and decision options — investigate, retrain, roll back, or accept.
Acknowledgement records that a person has seen the alert and is responsible for it. Resolution records what was found and decided, with a reason: "data-quality issue in upstream feed, fixed", "real drift, retraining scheduled", or "seasonal, threshold adjusted with approval". Unacknowledged alerts escalate after a set time. Reviewing resolved alerts monthly shows which thresholds are too sensitive and which risks recur.
Common mistakes
- Treating every drift signal as model failure: check data quality first.
- Rolling references only: slow drift becomes invisible.
- Uncalibrated thresholds: borrowed rules of thumb produce floods of alerts or silence.
- Average-only accuracy: group failures stay hidden.
- Fairness metric chosen after the fact: decide the criterion in governance before deployment.
- Alerts without owners or acknowledgement: nothing happens.
Guided practice
- Compute PSI for a feature across 12 weekly windows of historical data and set a threshold from its normal range.
- Introduce a unit-change error into one feature and observe which monitors fire first.
- Compute recall and false positive rate by region for the churn model and the ratios to the largest region.
Hands-on lab: A drift and fairness monitor
- From the Lesson 3 monitoring store, compute weekly PSI for every feature, the score, and the decision rate against fixed and rolling references.
- Compute decision-rate, recall, and false-positive-rate ratios by two segments once outcomes are available.
- Define five alerts with severity, owner, persistence, and runbook link.
- Replay three months of data with a simulated drift event and record which alerts fire, their acknowledgements, and resolutions.
- Write a one-page monthly governance summary from the results.
Review questions
- How do data drift and concept drift differ, and when can each be detected?
- How is PSI computed, and what does a value of about 0.1 suggest?
- Why combine fixed and rolling reference windows?
- Why can fairness criteria conflict?
- What must every alert definition include?
- What is the difference between acknowledgement and resolution?
Applied challenge
A hiring-screen model shows stable overall precision, but the share of applicants from one region who are advanced to interview has fallen by a third over two months. Lay out the investigation: which drift and fairness analyses to run, in which order, who must be involved, and the criteria for pausing the model.
Lesson summary
Monitor inputs, scores, decisions, and outcomes against both fixed and rolling references, using measures such as PSI with thresholds calibrated on normal variation. Compare performance and decision rates across groups with governance-chosen criteria and honest uncertainty. Turn signals into owned, severity-ranked alerts that are acknowledged, resolved with reasons, and reviewed.
Lesson status: Ready for review.