Demonstration 1 of 1
Sampling-only gaps and a small true gain, by public sample size
With no shift and no leak, how far does the CV-LB gap move from sampling alone, and can a public sample of a given size reveal a candidate that is truly better by a small amount?
An unchanged model has no gap pattern to find, yet its gap moves by sampling alone, by a lot at small m. The candidate's real gain is much smaller than that movement, so a raw reading (did the public score go up or down?) fails often. The two models make nearly the same errors on each row, so their per-row difference has a far smaller spread than either score. Pairing uses that; reading the two scores as independent does not.
Scroll sideways for the whole equation
gap = public loss - local loss (the chapter's definition for a loss). d_i = l_i(baseline) - l_i(candidate) is the per-row paired loss difference, m the public rows, and SE = sd(d_i) / sqrt(m) its standard error; a positive d means the candidate is better.
Predict first. With 1,000 public rows, how often does a candidate that is truly better by about 0.002 log loss look worse than the baseline on the public sample?
Choose an example
Scroll sideways for the whole figure
Constructed example: seeded synthetic rows and logistic models, measured by the chapter activity. The numbers describe this generator only.
Calculated values
- Gap spread (public sampling)
- 0.014
- Gap spread (development side)
- 0.009
- True gain
- 0.0021
- Better candidate looks worse
- 16%
- Paired detects
- 19%
- Unpaired detects
- 0%
With 1,000 public rows an unchanged model's gap wanders by a standard deviation of 0.014 from public sampling alone, and by 0.009 from the development side, against a true gain of 0.5496 - 0.5475 = 0.0021. The truly better candidate looks worse on 16% of public samples. Read as two independent scores the gain is found in 0% of samples (standard error 0.020); read as a paired difference it is found in 19% (standard error 0.002).
Worked steps
- True gain: 0.5496 - 0.5475 = 0.0021 (baseline minus candidate loss on 60,000 hidden rows).
- Sampling-only gap spread, public side: 0.014; development side: 0.009.
- Share of public samples where the better candidate looks worse: 16%.
- Share detected at 1.96 standard errors: paired 19%, unpaired 0%.
Use the idea
Do not read a gap change of the size shown here as a diagnosis. Compare candidate and baseline on the same rows with a paired difference and its standard error, and ask for more rows or blocks before deciding.
Where the conclusion applies
Constructed data with no shift, no leak and no selection, one logistic model pair, 20 competitions of 300 public draws each. Real gaps add population shift and selection on top of the sampling spread measured here. The unpaired rule is a deliberately naive reading of two public numbers, shown to contrast with the paired one. The local-side spread comes from a 3,000 row development set and is measured across competitions.
Check your understanding: Why can the paired comparison detect a real gain that the two raw public scores cannot, using the same public rows?
Chapter 4 source: section "The Three Gap Patterns".