5.3.12 · D1MLOps & Deployment

Foundations — Model monitoring and observability

2,303 words10 min readBack to topic

Before you can read a formula like , you need to earn every piece of it: what a distribution is, what a proportion is, what does, what "sum over bins" means. We build them one at a time, each on top of the last. A smart 12-year-old should never hit a symbol we didn't first draw.


0. The raw ingredients: data, features, labels

The picture: imagine a spreadsheet. Each row is a data point. The coloured columns are features . The final column is the true label . The model reads the coloured columns and scribbles its guess in the margin.

Why the topic needs it: monitoring watches three different things — the incoming (data drift), the outgoing (prediction drift), and the eventual truth (performance). If you can't tell these three apart, every later sentence collapses.


1. Distribution — the shape of "how often"

If you don't know what a distribution is, the words "data drift" mean nothing. So we build it visually first.

Figure — Model monitoring and observability

Look at the figure. The horizontal axis is the feature value (income). Each vertical bar is a bin — one bucket. The taller the bar, the more common that range of values.


2. Proportion — turning counts into fractions

Raw counts are unfair: a reference batch of 10,000 rows and a new batch of 500 rows can't be compared bar-height to bar-height. So we convert counts into proportions.

The picture: take the bar chart from figure s01 and re-label every bar height as a fraction of the whole. Now the reference chart and the new chart are on the same footing — you can lay one over the other.

Why the topic needs it: PSI compares against bin by bin. Without proportions the comparison would be dominated by whichever batch is bigger.


3. The subtraction — "did this bin grow or shrink?"

Figure — Model monitoring and observability

Why not stop here? You might think "just add up and call it drift." That's a real measure (it's called total variation). But it treats a shift from 40% to 20% the same as 4% to 2% — yet the second is a proportionally bigger upheaval. We need a tool that notices ratios, not just gaps. Enter the logarithm.


4. The logarithm — measuring how many times bigger

We chose the log-ratio because it answers a specific question: "by what multiplicative factor did this bin change?" A gap subtracts; a ratio divides; the log turns that ratio into a clean, sign-aware number.

Figure — Model monitoring and observability

5. The summation — collecting every bin into one score

We have one number per bin. We want one number for the whole feature. The tool that "adds up a list" is the summation sign.

See Data drift and concept drift for how this number is read in practice, and KL divergence and cross-entropy for why this exact log-ratio form is a symmetrised relative entropy.


6. The cumulative distribution and the supremum

PSI needs you to choose bins. For a smooth continuous feature, choosing bins is arbitrary. The KS statistic dodges that by comparing cumulative curves instead.

Figure — Model monitoring and observability

In the figure, two staircases climb the same box. Where the new data sits further right, its staircase lags behind — and the biggest vertical gap between the two curves is marked by the yellow arrow.


7. The indicator and windowed accuracy

When true labels eventually arrive, the gold-standard check is simply "is the model still right?" — measured on a recent window of data.


8. The probability symbols , ,

These three appear in the parent's failure table. They look scary but say simple things.


Prerequisite map

Data point: X features, Y label, Y-hat guess

Distribution: shape of how often

Proportion: counts turned into fractions

Signed gap a_i minus e_i

Logarithm: how many times bigger

Per-bin term times log-ratio

Summation: add over all bins

PSI single drift score

CDF F of x: fraction below x

Supremum: biggest vertical gap

KS statistic D

Probability P of X and P of Y given X

Data drift vs concept drift

Indicator and sliding window

Windowed accuracy

Model monitoring and observability


Equipment checklist

Cover the right side and test yourself — if any answer is fuzzy, re-read that section before tackling the parent topic.

I can state what , and each mean
= input features, = true label, = the model's prediction (hat = estimated).
I can explain a distribution as a picture
A bar chart of how often each value/range occurs; heights are counts or proportions.
I know why we use proportions not raw counts
So batches of different sizes are comparable; all proportions sum to 1.
I can read the sign of
Positive = bin grew, negative = bin shrank, zero = no change.
I know the three key facts of
; for ; for .
I can explain why every PSI term is
and always share the same sign, so their product is non-negative.
I can expand a
It means add the term for bin 1 plus bin 2 ... plus bin .
I know what is
The cumulative fraction of data at or below ; a staircase rising 0 to 1.
I know what picks out in KS
The single largest vertical gap between the two CDFs.
I can read aloud
"Probability of given " — the true input-to-output rule.
I can distinguish data drift from concept drift
moving vs moving.
I know what returns
1 if the prediction is correct, 0 if wrong.

Connections