A sealed test set and a ledger of every look
Every look at a held-out score can steer the next choice. Decide how you'll judge the model before you look, seal the test set if you want the app to enforce it, and keep an append-only record of each look and reveal.
You will be able to
- Explain how repeated looks turn a test set into development data
- Freeze an evaluation plan before revealing the test set
- Use Predict's test seal and read the evaluation ledger
- Say what to do after a test set has been reused
Read first
Every look costs something
ReadA test set is honest because nothing about the model was chosen with it. Look at it, change something, and look again, and that stops being true: the second model was shaped by the first test score. Do this a dozen times and the test set has become development data with a reassuring name.
This is adaptive overfittingAdaptive overfittingRevising a model after looking at a held-out score turns that set into development data, so its later scores read too well.. It happens without any bad intent, one sensible tweak at a time. Renaming the old split "test v2" doesn't undo it. After substantial iteration, the only clean estimate comes from data nobody has looked at.
Paths add up
ExploreEach extra analysis tried on the same data is another chance to find something by luck. Turn the forks on and off, and watch how often a study of nothing reaches p < .05.
BExplorable · The garden of forking paths
How often does a study with no effect find p < .05 if the analysis is chosen after seeing the data?
With these choices, how often will a study of nothing find p < .05?
Commit your prediction above to see the result
Make your prediction to see the result.
Repeated looks at one test set work the same way. Each look you act on is a fork.
Decide how to judge before you look
ReadWrite the evaluation plan while the test set is still closed:
- the primary metric, and how much of a difference would matter;
- the threshold rule, set on out-of-fold predictions, never on the test set;
- the slices you'll report, chosen in advance, not after spotting a weak one;
- the models that will be checked.
Freeze it. Then reveal the test results once, for exactly those models. Anything you notice afterwards is a new question for new data.
The Evaluate step
In the appPredict's Evaluate step follows that order: "Decide how to judge the model, freeze the plan, then look at the test set once."
- Evaluation plan: Primary metric; Threshold rule (Default 0.5, Least cost chosen out-of-fold, or A fixed threshold, with the two error costs); Report results by (slice columns); Runs to check on the test set.
- Out-of-fold checklist, Comparisons (out-of-fold) and Results by slice, all before any test number.
- Test set: reveal for the frozen plan's runs. The threshold chosen out-of-fold is applied unchanged.
Freezing records the plan's fingerprint in the ledger.
The seal and the ledger
In the appThe test seal is a switch in Validation: Seal the test set until I reveal it. It is off by default. While it is on, every test-set number in the experiment is hidden (the model card shows "Sealed") until a recorded reveal in the Evaluate step. Revealing again later is flagged "test set reused". Nested cross-validation fits never touch the test set, so the seal doesn't block them.
The Evaluation ledger is append-only. It lists test results shown, plans frozen, reveals, the seal turned on or off, and task-contract edits made after a reveal. The Evaluate step sums it up: "test results viewed … times · revealed … times".
After a reuse
ReflectThe ledger says the test set was revealed three times. You can't make that history go away, and you shouldn't hide it. Report the number of reveals and what changed between them, treat the last test score as optimistic, and get new evaluation data if the decision depends on it.
Have you ever tuned "one more thing" after seeing a test score? Would your report have mentioned it?
Check: sealed tests
CheckpointCheck yourself
A team checks its test score after every change and keeps the changes that raise it. After twenty rounds, what does the test score estimate?
Show the answer
Answer: b
Each kept change was selected for doing well on these particular rows. Only untouched data gives an unbiased estimate after that.
Check yourself
When should the threshold for a binary model be chosen?
Show the answer
Answer: a
A threshold tuned on the test set uses the test labels. Choosing it out-of-fold and freezing it keeps the test result honest.
Check yourself
What does turning on the test seal do in Predict?
Show the answer
Answer: b
The seal enforces the order: choose on out-of-fold results, freeze a plan, then reveal. Each reveal is recorded, and later reveals are flagged as reuse.
Check yourself
Which event is NOT written to the evaluation ledger?
Show the answer
Answer: d
The ledger records looks at the test set and the events around them: plans, reveals, the seal and contract edits after a reveal. Training runs have their own history.
Check yourself
After many rounds of tuning against the test split, a colleague proposes calling it "validation" and using a random half of it as the new test. Does that restore an unbiased test?
Show the answer
Answer: b
What matters is whether the rows influenced the model, not their label. Fresh data is the only clean estimate.
Check yourself
The test seal is on. Can you still run nested cross-validation?
Show the answer
Answer: a
Nested fits use outer and inner folds of the development data. The sealed test rows stay out of them, so the seal allows them.
Recap
Recap- Every look you act on turns test rows a little more into development rows.
- Freeze the plan (metric, threshold rule, slices, models) before the reveal; the out-of-fold threshold applies unchanged to test.
- Predict's seal is optional; it hides test numbers until a recorded reveal and flags later reveals as reuse.
- The append-only ledger keeps every look, freeze, reveal, seal change and late contract edit.
Concepts in this lesson