research29 min studyLesson 870 in Engineering

Selective prediction threshold validation

Freeze the full selective policy before final testing, quantify accepted-case error uncertainty, and prevent threshold search from reusing the claimed test evidence.

On this page

What you’ll understand

  • Separate policy selection from final evaluation and repeated release decisions.
  • Derive the zero-error one-sided binomial upper confidence limit under fixed-policy iid sampling.
  • Report coverage, accepted support, errors, uncertainty, and review-capacity evidence together.

A threshold chosen because it looked best on a labeled test set is already adapted to that set. Its apparent error rate is no longer an untouched assessment of the chosen policy. Selective prediction makes this especially tempting because many thresholds can trade a few mistakes for a smaller accepted denominator. Establish the data roles before searching, freeze the complete decision chain, and treat final accepted-case error as an estimate with sampling uncertainty rather than a certificate of zero risk.

Freeze every choice that determines acceptance

Policy selection includes more than the numeric threshold. The model checkpoint, score transformation, calibration fit, tie rule, allowed input types, subgroup routing, and overload fallback all determine which cases are accepted. Choose these on development and designated selection data. Keep final evaluation labels inaccessible until the policy and release criterion are fixed. If evaluation feedback leads to a change, that feedback has become development evidence; a revised policy needs fresh final evidence or a prespecified adaptive-valid analysis.

Create splits at the independent target unit, such as customer or source document, rather than randomly dividing near-duplicate records. Match the intended workload or explicitly weight the evaluation to it with appropriate uncertainty accounting. Report accepted support by important slices because an overall selective error estimate may conceal near-zero coverage for a group. Human review outcomes also need an observation plan that avoids measuring only the cases for which labels were easiest to obtain.

ϕ^=mN,R^sel=em,m>0\widehat\phi=\frac{m}{N},\qquad \widehat R_{\mathrm{sel}}=\frac{e}{m},\qquad m>0
For a frozen policy, N is the positive total test count, m the accepted count, and e the accepted zero-one error count, with 0 ≤ e ≤ m ≤ N. Rates are dimensionless. No accepted cases means zero empirical coverage and no defined empirical selective risk, not a zero-risk estimate.↔ Scroll wide equations horizontally.

Zero observed errors still leave an upper risk bound

Under a fixed deterministic selector with positive population coverage and iid labeled test pairs from a fixed population, conditional on a positive accepted count, accepted errors follow a binomial law with the population’s accepted-case error probability. This requires acceptance to depend on the fixed policy and input, not on inspecting test labels. For zero observed accepted errors, invert the probability of that event to obtain a one-sided exact binomial upper confidence limit. It can be surprisingly large when the accepted sample is small.

The confidence statement concerns repeated samples generated by the assumed experiment. It is not a posterior probability that this particular unknown risk lies below the computed number. Its zero-error expression applies to the observed-zero branch; a full binomial confidence procedure supplies the other branches. Correlation, label error, selection across many tested policies, and optional stopping can invalidate the simple iid fixed-sample interpretation. Use a matching analysis or redesign collection rather than treating additional decimal places as additional assurance.

Pr(E=0∣m)=(1−r)m,rupper=1−δ1/mwhen E=0\mathbb P_r(E=0\mid m)=(1-r)^m,\qquad r_{\mathrm{upper}}=1-\delta^{1/m}\quad\text{when }E=0
Assume a policy frozen independently of test labels, iid test pairs from the target population, and a prespecified test size and analysis. Conditional on m ≥ 1 accepted cases, E is binomial with accepted-case error probability r. For 0 < delta < 1, this is the zero-error branch of a one-sided exact (1−delta) confidence procedure; it is dimensionless.↔ Scroll wide equations horizontally.

Turn a test result into a bounded release claim

Predeclare the acceptable risk, minimum coverage, review capacity, and slice-support requirements. A policy with zero errors among ten accepted cases may fail a 5% risk gate because its upper confidence limit is much larger. Searching many thresholds and reporting only the best unadjusted limit is not the same experiment as validating one frozen threshold. Separate selection data are straightforward; simultaneous bounds, sequential tests, or learn-then-test methods can support other workflows only when their actual assumptions and multiplicity handling are followed.

The probability lab shows why zero errors can occur at a nonzero rate. Reset, set p to 0.05 and n to 10, predict zero-error probability approximately 0.5987, then Step. Compare a fresh Reset with both p at 0.05 and n at 30 before Step: approximately 0.2146. It displays exact independent-binomial masses rather than sampled evidence. It does not choose a threshold, compute confidence bounds, model optional stopping, or establish that a real test population has the supplied error rate.

A zero-error test does not prove zero risk

A frozen gate is evaluated on 200 iid labeled arrivals and accepts 100, with no accepted errors. Use the zero-error branch of a one-sided 95% exact binomial interval. Assume all model and threshold choices were fixed before viewing these test labels.

  1. Empirical coverage is 100/200 = 0.5. The empirical accepted-case error is 0/100 = 0, based on 100 accepted observations rather than 200.

  2. With delta = 0.05 and m = 100, the upper error limit is 1 − 0.05^(1/100) ≈ 0.02951, or 2.951%.

  3. A prespecified risk target of 2% is not established by this upper bound, while a 5% target passes this risk component alone. Coverage, slices, cost, label quality, and review capacity remain separate release criteria.

The result

The supported claim names the sampling assumptions, accepted count, confidence procedure, and prespecified target.

Explore the model

Interactive lab

Interactive lab · probability

A nonzero risk often produces zero small-sample errors

Reset, set p = 0.05 and n = 10, predict P(E=0) ≈ 0.5987, then Step. Compare a fresh Reset with both p = 0.05 and n = 30 before Step: P(E=0) ≈ 0.2146. Exact independent-binomial masses are not sampled test results, confidence limits, or threshold-selection corrections.

A nonzero risk often produces zero small-sample errorsThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forZero observed errors require a denominator and an uncertainty analysis.

Check your understanding

A team tries 100 thresholds on its final test labels, selects the one with zero errors, and reports a single-policy 95% interval without adjustment. What is the appropriate conclusion?

Try it yourself

A separately frozen gate accepts 30 of 60 iid test cases with zero accepted errors. Compute coverage and the zero-error one-sided 95% upper limit. Would this establish a prespecified 5% accepted-risk target under the stated analysis?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Use delta = 0.05 and m = 30 in 1−delta^(1/m). The total arrival count is the coverage denominator, not the accepted-risk sample size.

Compare with the solution

Coverage is 30/60 = 0.5. The upper limit is 1 − 0.05^(1/30) ≈ 0.09503, or 9.503%, so this test does not establish a 5% risk target with that confidence procedure. It also does not prove the true risk exceeds 5%; the evidence is insufficient for the claimed upper bound. More representative independent evidence or a different prespecified valid procedure may resolve the release decision without reusing labels to search for a favorable threshold.

Take it with you

  • Freeze the entire gate and fallback before final test labels are used.
  • Use the accepted denominator and a sampling-aware uncertainty procedure.
  • Selection, repeated testing, and stopping need analyses that match their actual protocol.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.