5.3.14 · D3MLOps & Deployment

Worked examples — A - B testing for models

2,305 words10 min readBack to topic

This is the hands-on companion to A - B testing for models. The parent note built the two-proportion -test and the sample-size formula. Here we run the machine on every kind of input it can receive — a clear win, a clear loss, a "too small to trust" case, a degenerate zero-conversion group, the huge- trap, a real-world word problem, and an exam twist. If a scenario can happen in a real experiment, it lives in the table below and gets its own worked example.

Before we start, one reminder of the three symbols we lean on, in plain words:

We reject the null (declare a real difference) when the p-value drops below , i.e. when .


The scenario matrix

Every A/B test outcome falls into one of these cells. The examples below are labelled by cell so you can see the whole space is covered.

Cell What's special about the input Sign of Decision it forces
C1 Clear win large , gap well above noise reject , ship candidate
C2 Clear loss large , B clearly worse reject , keep A
C3 Underpowered real-looking gap but too small fail to reject — need more data
C4 Null / A-A B A, sanity check must NOT reject (else pipeline bug)
C5 Degenerate zero one group has conversions either formula still works; watch
C6 Huge- trap tiny gap, millions of users significant but practically useless
C7 Sample size plan the run before data compute from MDE
C8 Word problem messy real numbers + guardrail significance AND guardrail check

We will hit all eight.

Figure — A - B testing for models

The picture above is the mental model for the whole page: a bell curve of "gaps we'd see by pure luck if A and B were identical." The red shaded tails past noise-widths hold of the area — that is . Every example just asks: where does our measured land relative to those red tails?


The reusable recipe

For a two-proportion test, every example runs the exact same five lines. Pin them once:

Here is the "area-so-far under the bell curve" function (from Central Limit Theorem and Confidence Intervals). , so a of leaves in each tail, total. That single fact is why is the magic threshold.


Worked examples

C1 — A clear win

C2 — A clear loss

C3 — The underpowered look-alike

This is exactly Example 1 from the parent, re-derived as the "looks real but isn't proven" cell.

C4 — The null / A-A test

C5 — The degenerate zero-conversion group

C6 — The huge- significance trap

C7 — Planning the sample size

C8 — Word problem with a guardrail (exam twist)


Recall Which cell am I in? — quick router

Big gap, big , positive ::: C1, ship. Big gap, big , negative ::: C2, keep A. Nice gap but ::: C3, underpowered — collect more data, don't peek-and-stop. Same model twice ::: C4, A/A — must NOT reject; if it does, pipeline bug. One group has conversions ::: C5, pooled SE stays finite — formula holds. Significant but tiny lift on millions ::: C6, check effect size + CI, maybe skip. No data yet, planning ::: C7, use the formula. Win on OEC but a guardrail regressed ::: C8, guardrail can veto — don't ship.