5.3.11 · D1MLOps & Deployment

Foundations — CI - CD pipelines for ML

2,085 words9 min readBack to topic

Everything in the parent note is built from a small pile of ideas and symbols. Below we lay each one down from absolute zero — plain words first, a picture second, and only then the notation. Nothing is used before it is earned.


1. The three things that change

Before any symbol, hold this picture in your head: three sliders that move independently.

Figure — CI - CD pipelines for ML

2. A "pipeline" and its arrows — reading a flow diagram

The parent draws a chain of boxes with arrows. If you have never read one: a box is a step that does work, and an arrow means "when this finishes, hand the result to the next box." It is a recipe read top to bottom.

We need this vocabulary because the entire topic is "what happens between the trigger and the user."


3. Held-out test set, and the symbol

Every quality decision in the pipeline rests on measuring a model. You cannot measure it on the data it studied — that is like grading a student on the exact questions they memorised.


4. A score , and comparing two models

We give a model one number summarising how good it is on the held-out set. Call it a score, symbol .

Higher = better. The pipeline's central question is: is enough bigger than to bother replacing it?


5. Accuracy as a proportion — a picture of the score

The most common score is accuracy: out of test examples, what fraction did the model get right? A fraction between 0 and 1 gets the symbol (for proportion).

Figure — CI - CD pipelines for ML

6. Noise in a measured score — standard error

Here is the subtle idea the parent leans on hardest. If you tested the same model on a different random batch of examples, you would get a slightly different . The score wobbles. That wobble has a size, and it has a name: the standard error, .

Figure — CI - CD pipelines for ML

Let us earn every piece of this formula, because it is used as a black box in the parent:

Recall Quick sanity check on

With , : . So a raw accuracy of really means "somewhere around ."


7. The margin — turning noise into a rule

Now we can read the parent's promotion rule symbol by symbol.


8. Drift and PSI — why the belt loops back

A model can pass every gate today and be wrong next month because the incoming data changed shape. That change is drift, and we need one number to measure it so a machine can raise the alarm.


9. Artifact, registry, container — the plumbing symbols

Three more nouns the parent uses without defining:


How the foundations feed the topic

Code data model triangle

Pipeline of steps

Trigger event

Held out test set size n

Score s new vs s prod

Accuracy proportion p

Standard error SE

Promotion margin delta

Promotion gate

PSI drift number

Model registry artifact

Container deploy

Monitor then loop

Read it top-down: the triangle motivates a pipeline; a trigger starts it; the test set produces scores; accuracy feeds noise, noise feeds the margin, and score-plus-margin makes the gate; passing artifacts go to the registry, ship in a container, get monitored, and monitoring's PSI re-triggers the loop.


Equipment checklist

Cover the right side; can you answer before revealing?

The three things that change independently in ML
Code, data, and model.
What a "trigger" is, with three examples
The event that starts the pipeline: a git push, a schedule (cron), or a drift alarm.
Why you grade a model on a held-out set and not training data
Training data measures memory, not skill; the held-out set is a surprise exam.
What the symbol counts
The number of examples in the held-out test set.
Meaning of and
Score of the candidate model vs. the current production model.
What means and its range
A proportion (e.g. accuracy) = fraction correct, between 0 and 1.
The standard error formula and why appears
; measures how jumpy a coin of bias is (max at 0.5).
Why shrinks with more data, and at what rate
Averaging cancels flukes; uncertainty falls like , so 4× data halves it.
The promotion rule in symbols, and what means
; = "exactly when."
Why the margin uses
A gain beyond ~2 standard errors is ~95% likely to be real, not noise.
What PSI is and its retrain threshold
Population Stability Index measuring data-distribution shift; fires a retrain.
Difference between a model artifact, a registry, and a container
Artifact = saved weights file; registry = versioned store of artifacts; container = sealed code+environment for identical runs.

Connections