5.3.15 · D3MLOps & Deployment

Worked examples — Model retraining pipelines

3,189 words14 min readBack to topic

Before we start, one piece of notation the parent used that we will lean on here:


The scenario matrix

Every case class this topic can produce, and the example that covers it:

Cell Case class What makes it tricky Example
A PSI, stable feature () Must return ; do NOT retrain Ex 1
B PSI, significant drift () Trigger fires Ex 2
C PSI, degenerate empty bin ( OR ) blows up on either side Ex 3
D PSI limiting case, everywhere The exact-zero boundary Ex 4
E Cost logic — retrain is worth it Benefit cost Ex 5
F Cost logic — retrain too often (net loss) Benefit cost Ex 5
G Champion–challenger, inside noise band Do NOT promote Ex 6
H Champion–challenger, beats margin Promote Ex 6
I Drift high but accuracy fine (concept-stable) Trap: don't ship blindly Ex 7
J Word problem — pick the trigger type Reasoning, not arithmetic Ex 8
K Exam twist — data drift vs concept drift diagnosis Which moved? Ex 9

We build the machinery once, then reuse it. Two tools appear repeatedly, so let us pin them down in plain words first.

Figure — Model retraining pipelines

Read the figure above like this. The lavender bars are the training fractions , the coral bars are the recent production fractions , one pair per bin along the horizontal axis; the vertical axis is "fraction of samples". Above each bin, the mint number is that bin's PSI contribution — notice every one is positive. That is the key visual: because and always share a sign, no bin can ever push the total downward, so PSI can never be negative. Keep that picture in mind for every example.


Worked examples

Cell A — stable feature, do NOT retrain


Cell B — significant drift, trigger fires


Cell C — degenerate: an empty bin (either side)


Cell D — limiting case: identical distributions


Cells E & F — cost logic: worth it vs net loss


Cells G & H — the promotion gate


Cell I — high drift, but accuracy fine (the trap)


Cell J — word problem: choose the trigger


Cell K — exam twist: diagnose the drift type


Active recall

Recall One line per cell (hide the answers)

Cell A — stable PSI value, decision? ::: PSI ; do NOT retrain. Cell C — production bin OR training bin is , what breaks and the fix? ::: or ; -smooth both sides then renormalise. Cell D — identical distributions give PSI = ? ::: Exactly (the floor; everywhere). Cell F — why can daily retraining lose money? ::: 7\times\800=$5600\sim$10$140.015\delta=0.010.015>0.01P(X)P(Y\mid X)$ changed) → must retrain.