Promotion gates: is the new version good enough?
Write the conditions a version must meet before it's approved or becomes champion, compare it with the champion on the same rows, and record any override.
You will be able to
- Explain why two models should be compared on the same rows, with a margin
- Write gates on a version's scores, the champion's scores and its reproducibility check
- Predict what a gate with no value to judge does
- Override a held promotion with a reason that stays on record
Better by how much?
PredictPredict first
A new version beats the champion by half a point of AUC on the test rows. What should happen next?
Reveal
Compare them on the same rows, against a margin. Half a point could be noise. And "better" may be the wrong question: a fresher or simpler model can be worth having even if it only ties. What you usually need to know is whether it's worse by more than you can accept.
Two models, the same rows
ReadTwo models scored on the same rows share most of their noise: a hard row is hard for both. Comparing two separate intervals throws that away.
A paired bootstrapPaired bootstrapResampling the same rows for two models and recomputing the difference, so row-to-row luck doesn't count against either. resamples rows, keeps each row's two predictions together, and recomputes the difference each time:
The app does this 2,000 times on the held-out rows. A version is non-inferiorNon-inferiority testAsks whether a new option is no worse than the standard by more than a margin chosen in advance, rather than whether they differ. when the 95% interval of stays above , where is your margin. For a metric where lower is better, such as RMSE, the interval has to stay below .
Not worse by more than you can accept
ExploreNon-inferiority is one half of an equivalence test: only the side that would hurt has to clear.
BExplorable · Two one-sided tests
How do you show that two things are the same, not merely that you found no difference?
What can you conclude here?
Inconclusive: neither test rejects
Equivalent when the whole 90% interval sits inside the margins. TOST p = .068; ordinary test p = .618.
Commit your prediction above to see the result
Make your prediction to see the result.
Shrink the margin, then raise n, and watch when the interval fits. Notice that a large p from the ordinary test isn't what gets you there. The evidence comes from a narrow interval.
This explorable uses the 90% interval that equivalence tests use. The gate's two-sided 95% interval is stricter: a one-sided test at on the side that matters.
Gates are conditions
ReadA gate is a condition in the same language as alert rules. Add a gate offers these templates:
noninferior(metric = "roc_auc", margin = 0.01)
roc_auc >= 0.7
reproduces()
rows() >= 1000
A bare metric name reads the version's test score when it has one, and otherwise its cross-validated score. cv_roc_auc and test_roc_auc ask for one explicitly, champion.roc_auc reads the champion's score, and rows() counts the training rows.
The templates fill in your model's primary metric where these show roc_auc.
When a gate has nothing to read
PredictPredict first
A blocking gate reads f1 >= 0.6, but this version never recorded an F1. What happens when you try to approve it?
Reveal
It holds the step, and shows No value to judge. No evidence isn't a pass. Compare that with an alert rule, which stays quiet without evidence: alerts need a reason to speak up, while gates need a reason to open.
The one exception: if there's no champion yet, non-inferiority gates have nothing to compare with, so they pass and a note says so.
Read the comparison
ExploreA check with a paired gate draws each metric's interval next to its margin.
View data
| metric | difference | low | high | margin |
|---|---|---|---|---|
| ROC AUC | 0.0064 | −0.0080 | 0.0160 | 0.0100 |
| F1 | −0.0059 | −0.0120 | 0.0060 | 0.0100 |
| Log loss (flipped) | −0.0168 | −0.0300 | −0.0060 | 0.0100 |
Right favors the candidate, and metrics where lower is better are flipped so this stays true. Passing means the whole interval sits to the right of the dashed margin.
Look for a metric whose point estimate is inside the margin while its interval crosses the line. That's a version you can't call non-inferior yet, which isn't the same as calling it worse.
When the split plans differ
ReadTwo versions from one experiment share a split plan, so their held-out rows match directly.
When the plans differ, the app scores the champion on the candidate's held-out rows, and says so in a note. Some of those rows may have been in the champion's training data, which favors the champion. So treat that comparison as conservative, and retrain on a shared plan when the decision is close.
Set the margin before you look
ReflectA margin is a decision about the business, not a statistical result. It answers: how much accuracy would you give up for what the new version offers, such as fresher data, a simpler model or lower cost?
Choose one for a model you know, and write down why. If you choose it after seeing the comparison, it will tend to land wherever lets the version through.
Set up a gate
In the appOpen a version's Gates & policy tab.
- Use Add a gate, then press Save. The policy belongs to the model, not to one version.
- Under Gates guard, choose the steps it covers. By default, these are Stage: Approved and Becoming champion.
- Press Check this version against the gates to see the result without promoting anything.
Turn off Blocking for a gate that should only warn.
Overriding, on the record
ReadAnyone can override a held step, by writing a reason in the promotion dialog. There's no silent way past: Override and go ahead stays disabled until a reason is there.
The Audit log keeps every guarded step: what was asked, what the gates said, and the reason. An override can be the right call, such as an urgent fix for a known fault. The log means someone can ask about it later.
Check your understanding
CheckpointCheck yourself
The margin is 0.01. Candidate minus champion on AUC has a 95% interval from −0.006 to 0.014. Is the candidate non-inferior?
Show the answer
Answer: a
Non-inferiority asks whether the candidate could be worse by more than the margin. Being better isn't required, so including zero is fine.
Check yourself
With the same margin, another candidate's interval runs from −0.03 to 0.03. What can you conclude?
Show the answer
Answer: c
A wide interval that crosses the margin doesn't show harm or safety. A gate holds the step here because the evidence falls short.
Check yourself
Why resample rows for both models together?
Show the answer
Answer: a
Pairing doesn't change either model's score. It lets row-to-row luck cancel out of the difference.
Compute it yourself
In the appGiven held-out outcomes and both models' scores on the same rows, you can reproduce the idea of the check. These scripts use their own random generators, so their intervals won't match the app's exactly.
import numpy as np
import pandas as pd
from sklearn.metrics import roc_auc_score
df = pd.read_csv("holdout_scores.csv") # y, champion, candidate on the same rows
rng = np.random.default_rng(1)
diffs = []
for _ in range(2000):
s = df.iloc[rng.integers(0, len(df), len(df))]
if s["y"].nunique() == 2:
diffs.append(roc_auc_score(s["y"], s["candidate"]) - roc_auc_score(s["y"], s["champion"]))
low, high = np.percentile(diffs, [2.5, 97.5])
margin = 0.01
print(round(low, 4), round(high, 4), "non-inferior" if low > -margin else "not shown")auc <- function(y, s) {
r <- rank(s)
n1 <- sum(y == 1)
n0 <- sum(y == 0)
(sum(r[y == 1]) - n1 * (n1 + 1) / 2) / (n1 * n0)
}
df <- read.csv("holdout_scores.csv") # y, champion, candidate on the same rows
set.seed(1)
diffs <- replicate(2000, {
i <- sample(nrow(df), replace = TRUE)
auc(df$y[i], df$candidate[i]) - auc(df$y[i], df$champion[i])
})
ci <- quantile(diffs, c(0.025, 0.975))
margin <- 0.01
print(round(ci, 4))
if (ci[1] > -margin) "non-inferior" else "not shown"Recap
Recap- Compare models on the same rows, and ask whether the new one is worse by more than a margin you chose in advance.
- Gates read the version's scores, the champion's scores and the reproducibility check.
- A gate with nothing to judge holds the step, since no evidence isn't a pass.
- Overriding takes a written reason, and the audit log keeps it.
Concepts in this lesson