5.3.12 · D3MLOps & Deployment

Worked examples — Model monitoring and observability

3,320 words15 min readBack to topic

Before any symbol appears, let us re-earn the two words we lean on constantly.


The scenario matrix

Every drift computation this topic can throw at you lands in one of these cells. The examples below are labelled by cell so you can see the coverage.

Cell What makes it tricky Covered by
A. All bins grow/shrink cleanly ordinary case, mixed signs Ex 1
B. A bin stays identical one term must vanish () Ex 2
C. Perfect match, PSI = 0 the degenerate "no drift" floor Ex 2
D1. Empty actual bin () — needs a fix Ex 3
D2. Empty reference bin () divide-by-zero — needs a fix Ex 3b
E. KS, shift right offset CDFs, sup at the step Ex 4
F. KS, identical samples degenerate Ex 5
G. KS, spread change (same mean) mean unchanged, shape changed Ex 6
H. Real-world word problem which tool? interpret the number Ex 7
I. Exam twist — drift ≠ retrain reasoning trap, not arithmetic Ex 8

PSI examples


KS-statistic examples

To read these, we only need the CDF ("cumulative distribution function").

Figure 1 below draws the Ex 4 CDFs so you can see the sup gap. The cyan staircase is (samples ); the white staircase is (samples , shifted right by 2). The amber arrow marks the largest vertical gap at : , , so .

Figure — Model monitoring and observability

Applied & exam scenarios


Recall

Recall Cover the answers
  • What does PSI stand for, and what does it measure? ::: Population Stability Index; how much a feature's distribution moved between reference and live data.
  • Why does a "stayed the same" bin add to PSI? ::: Both factors are : and .
  • What two singularities break PSI on an empty bin, and the fix? ::: (empty actual bin, Ex 3) and divide-by-zero (empty reference bin, Ex 3b); fix by flooring zeros with then renormalising.
  • Which combined set must you scan to find the KS sup gap? ::: All data points of both samples (including new-only points), not just the reference points.
  • Which drift did Ex 6 catch that a mean-check misses? ::: A spread/variance change with the mean unchanged.
  • When labels are delayed, which family of metric do you rely on? ::: Input/prediction drift proxies (e.g. PSI), not live accuracy.
  • Does a huge overnight PSI justify auto-retrain? ::: No — suspect a broken pipeline first; retrain only on confirmed concept drift.

Connections