5.3.13 · D1MLOps & Deployment

Foundations — Data drift and concept drift detection

3,165 words14 min readBack to topic

This page assumes nothing. Before you can read " changes" or "", every one of those squiggles has to earn its place. We build them one at a time, each on top of the last, each with a picture.


0. What is a "distribution" (the seed of everything)

Before any symbol, the single mental image you must own is a distribution: not a number, but a shape describing how often each value shows up.

Figure — Data drift and concept drift detection

Look at the picture: the horizontal axis is the value (age), the vertical axis is how common that value is. The whole topic of drift is nothing but comparing two of these shapes — one from the past, one from now — and measuring how far apart they drifted.

Why does the topic need this? Because a model was tuned to one shape. If the shape moves, the model's assumptions crack.


1. The symbols and

The picture: imagine a machine with input slots () on the left and a single output light () on the right. The model is the wiring in between.

Why the topic needs this: drift is defined entirely by which of these two things — the inputs or the input→answer wiring — has changed.


2. The symbol — "probability of"


3. Conditional probability — the "rule"

This is the most important symbol on the whole parent page, so we build it slowly.

Figure — Data drift and concept drift detection

The picture separates the two ideas cleanly:

  • = which people walk through the door (the input shape).
  • = for a fixed person, how the world decides their outcome (the rule).

Why the topic needs this split: drift comes in exactly two flavours, and they map perfectly onto these two objects. Data drift = the door-crowd changed. Concept drift = the deciding rule changed. Keep this figure in your head for the entire topic.


4. The joint distribution and the chain rule


5. Sample vs. true distribution — why we compare windows

Why the topic needs this: it turns an impossible question ("did the true change?") into a doable one ("do these two finite samples look alike?").


6. Binning, and the symbols ,

To compare shapes numerically we chop the value axis into slices called bins. This is exactly the "turn a continuous PDF into discrete heights" bridge promised in Section 0.

Figure — Data drift and concept drift detection

The picture shows the same axis binned twice — reference bars and current bars side by side. PSI, KL, and chi-square all just walk bin-by-bin and add up how much the bars disagree. Once you see and as "two bar heights in the same bin," those formulas stop being scary.


7. The tools that combine those bins

Now that and exist as pictures, we can name the machinery the parent uses — but only name it here (D2 derives them fully).

Figure — Data drift and concept drift detection

Two symbols still need unpacking: and (for KS), and (for chi-square). We define them right where each tool uses them.


8. Symbols for the concept-drift side

Concept drift needs the answer , so its symbols live around error. First, pin down the index.


The prerequisite map

The graph below is deliberately small: read it in three streams. (1) The far-left column is the conceptual spine — a distribution splits into the two factors, which combine and then split again into the two drift types. (2) The middle stream is the data-drift toolkit — samples become bins, bins feed the log-ratio scores. (3) The right stream is the two specialist tools — CDF-based KS and error-based DDM. All three streams pour into "full drift detection" at the bottom.

Distribution as a shape

P of X the inputs

Rule P of Y given X

Joint via chain rule

Data drift P of X moved

Concept drift rule moved

Bins r and c from samples

Sum and log ratio

PSI KL chi square

Error p s sigma over time

Full drift detection


Equipment checklist

Cover the answers; if you can state each, you are ready for D2.

What is a "distribution" in one sentence?
A description of how often each value occurs — a bucket-shape / histogram (discrete) or density curve (continuous) over the values.
What is the difference between a PMF and a PDF?
A PMF gives a real probability height on each discrete value (heights sum to 1); a PDF is a smooth curve where area under a range gives the probability (total area 1) and any single exact value has probability 0.
How do you feed a continuous feature into PSI/KL, which need heights that sum to 1?
Bin it — chop the range into slices and let each slice's fraction of points become a discrete height; or skip binning and use the KS test directly.
What is the difference between and ?
is the whole shape (one height per value); is the single height at the specific value .
Read aloud and say what it is.
"Probability of answer given inputs " — the model's input→output rule.
Write the chain rule and say why it forces exactly two drift types.
; the world can only drift if one factor drifts, so it's data drift or concept drift, never a third.
Which factor moves in data drift? In concept drift?
Data drift = moves; concept drift = moves.
Why compare a reference window to a current window instead of measuring directly?
We never observe the true , only finite samples, so we compare two samples.
What are and , and what breaks if a bin is empty?
Fractions of reference/current points in bin ; an empty bin gives or divide-by-zero, so add a small floor (smoothing) or merge the bin.
In chi-square, what are and , and how do they relate to ?
= observed current counts; = counts expected from reference proportions on a window of points.
Why does chi-square divide by ?
To scale each mismatch relative to what's normal for that category — a gap of 10 is huge if you expected 5, trivial if you expected 5000.
What does mean and what does pick out in the KS test?
= fraction of points (the cumulative staircase); picks the largest vertical gap between the two staircases.
In the concept-drift formulas, what does the index count?
A running time step / sample number as predictions stream in — not a bin.
What does measure?
The natural random wobble (standard deviation) of the error-rate estimate at step ; it shrinks as grows.
Why does DDM wait for a jump?
A rise that large is a ~0.1% luck event, so it's almost surely real degradation, not noise.