
Statistically Significant Nonsense · Episode 7
The committee, characters and dialogue are fictional. This satire targets methodological overclaiming, not the cited researchers. Sources provide evidence and qualifications; all numerical examples are constructed, not published benchmark findings.
Welcome to the selection committee
Our fictional hyperspectral lab is recruiting a classifier. Twelve candidates arrive, each wearing a slightly different combination of patch size, learning rate and architectural confidence. The committee interviews them, chooses its favourite and asks the successful candidate to write the independent assessment. Five stars. Excellent spectral awareness. Would appoint myself again.
This is what happens when the score used to select a model is also presented as independent evidence of its quality. The fitted predictor and the procedure that produced it are different objects. The procedure includes cleaning, band selection, tuning, early stopping and the final fitting rule. Those decisions do not disappear when the winning checkpoint receives a respectable filename.
Nested cross-validation gives selection and evaluation different jobs. The inner loop conducts the audition. The outer loop assesses the resulting selection procedure. It is particularly useful when a separate final test set is unavailable or expensive. The numerical examples here are constructed illustrations, not reported HSI findings. The committee is fictional. Its information boundary should be real.
The winner would like to review the winner
Suppose two equally effective candidates happen to score 82% and 85% on one validation sample. The committee chooses 85%. Reasonable. It then reports 85% as independently confirmed performance. Less reasonable. We have promoted the reason for the appointment into a reference from an impartial employer.
Validation estimates contain sampling variation. Maximising the estimate favours genuine quality and favourable estimation error. Cawley and Talbot analyse how overfitting the model-selection criterion affects subsequent performance comparisons. [1] They are providing the evidence, not attending our imaginary recruitment meeting.
The illustration does not establish a universal three-point bias. Candidate correlations, search design and evaluation sample all matter. Neither does it make selection improper. We are allowed to select promising models. We merely need an assessment that has not already spent the afternoon helping us choose the promising one.
Sources: [1]
Please keep the examiner out of the audition
For each outer split, reserve an evaluation partition and give only the remaining data to the selection procedure. Run the full inner validation process there. Choose a configuration using the predefined criterion, refit it on the entire outer-training partition, then predict the held-out outer partition once. The examiner receives a completed submission, not an invitation to help rewrite the answers.
Varma and Simon demonstrate the bias that arises when the cross-validation estimate optimised during tuning is reused as the reported error estimate. Their nested procedure puts tuning inside the outer evaluation loop. [2] This is a separation of information roles, not a certificate that every nested estimate is unbiased under every dependence structure.
In the fictional lab, somebody proposes emailing the outer score after each minor improvement. That is how an external examiner acquires a desk, a mug and an informal supervisory role.
Sources: [2]
PCA also needs a visitor pass
The classifier is not the only employee who can carry information across the boundary. Learned scaling, imputation, band selection, dimensionality-reduction rank and operating-threshold selection belong inside the appropriate training and selection partitions. A physically specified transformation fixed independently of these data has a different status. Check what was learned, not how innocent the preprocessing function sounds.
Ambroise and McLachlan show how feature selection performed outside validation can produce optimistic error estimates. [3] Selecting useful wavelengths using every reference label before creating the folds is the HSI version of giving the examiner's answer sheet to the feature selector and declaring the classifier admirably uninformed.
Within inner validation, fit learned transformations on inner-training data. For outer refitting, fit them on outer-training data. Cache immutable raw inputs if useful, but key fitted objects by their training partition. The globally fitted scaler does not become independent because it lives in a folder called utilities.
Sources: [3]
The audition has a GPU invoice
Consider five outer folds, four inner folds and twelve candidate configurations. The inner searches require 5 × 4 × 12 = 240 fits. Refitting one selected configuration in each outer fold adds five: 245 fits before final full-data training. This assumes one training run per candidate and inner fold. The arithmetic is exact; the GPU's expression is interpretive.
If each candidate is averaged across three optimisation seeds, say so. Also specify whether outer refitting uses three seeds. The budget changes with those choices. A comparison that counts only the final checkpoint is reporting the cost of the graduation photograph while omitting the degree.
An explicit smaller search may be more defensible than an enormous search repeatedly consulting the outer score. Different model families need not share identical hyperparameters. They do need a reasonably matched and documented opportunity to find a good configuration.
Twenty scenes have not become twenty thousand scenes
The outer partition defines the generalisation question. Holding out pixels from a familiar specimen differs from holding out specimens, scenes or acquisition campaigns. The inner design should select for the intended outer task, within the available data. Nesting an unsuitable split gives the unsuitable split an inner office. It does not give it a new scientific purpose.
With twenty independently acquired scenes, an illustrative five-fold outer design holds out four scenes each time. Inner validation partitions only the remaining sixteen. Keep associated crops, scans and labels with their scene. If a class disappears from a fold, report the constraint. Quietly retrieving replacement pixels from the outer holdout is not class balancing; it changes the evaluation boundary.
The resulting estimate concerns the scene population represented by those acquisitions. Another sensor or an absent geography has not been tested merely because the folder structure contains five levels.
What, exactly, did we appoint?
Aggregate outer predictions according to the intended quantity. Pooled pixel error gives larger scenes more weight. An equal-scene mean answers a different question. State the weights before a particularly large easy field becomes chair of the committee.
The outer estimate evaluates the procedure trained on the outer-training fraction. It is not a direct measurement of the final model later fitted on all available data. More training data can change performance. The final checkpoint may be excellent; its cross-validation score is still evidence about the evaluated procedure, not a personal performance review completed before it existed.
Preserve outer predictions and selected configurations. Variation in selected settings can expose selection instability. Do not respond by deploying whichever outer-fold model had the prettiest score. That invites the examiner back onto the hiring panel and restarts the very selection problem the nested design was meant to contain.
Five folds are not five independent referees
Outer folds share much of their training data. Their performance estimates are dependent. Treating them as independent studies and calculating an ordinary standard error without justification is like requesting five references from people sharing one office, one dataset and most of the same training examples.
Bengio and Grandvalet prove that no universal unbiased estimator of K-fold cross-validation variance exists under their general formulation. [4] This does not mean uncertainty is unknowable. It means the assumptions and dependence structure cannot be replaced by dividing the fold standard deviation by a square root and looking reassured.
Varoquaux illustrates substantial uncertainty with small samples and the inadequacy of the standard error across folds in the studied settings. [5] Those numerical results are not a universal HSI error bar. Report independent sampling units and justify the uncertainty method. Repeated nested splits describe partition sensitivity; they do not acquire more scenes while nobody is looking.
The independent examiner has joined the project
The first outer result is disappointing. The fictional committee changes the search space. The second suggests a new normalisation. The third inspires a postprocessing rule. By the fourth, the independent examiner is effectively supervising the thesis and should probably be receiving calendar invitations.
Repeatedly redesigning the procedure after inspecting outer outcomes makes the outer loop a development resource. Keep a dated analysis specification and record substantive revisions. Nested brackets in the code do not preserve an information boundary that the research process has already crossed.
If redesign becomes necessary, describe the existing outer analysis as exploratory and seek untouched confirmation data where feasible. Without such data, narrow the claim and disclose the adaptive history. Adding another layer of folds cannot make earlier knowledge disappear. The table below assigns the jobs before the examiner acquires a laboratory key.
| Stage | Permitted information | Output |
|---|---|---|
| Inner fitting | Inner-training observations | Fitted candidate pipeline |
| Inner selection | Inner validation scores | Configuration and fitting rule |
| Outer refitting | Entire outer-training partition | One selected predictor |
| Outer evaluation | Locked outer labels | Held-out predictions and score |
| Final fitting | All authorised development data | Deployment candidate requiring separate validation |
Release the minutes, including the awkward ones
Publish the candidate space, search algorithm, scoring rule, fold assignments, grouping unit, optimisation budget and stopping criterion. Retain unsuccessful candidates or a complete machine-readable search ledger. Otherwise the reader sees one victorious configuration and has to guess whether it defeated two alternatives or a small evolutionary civilisation.
After evaluation, apply the predefined selection procedure to the full development set and fit the final model. Preserve that artefact alongside the outer-evaluation record. One is the resulting predictor; the other supports the procedure-level claim under the specified sampling design. Neither establishes performance in deployment settings never represented.
Connect the record to experiment tracking. The practical repair is not to abolish auditions. It is to stop calling the audition an independent reference. Let the inner loop choose. Let the outer loop assess. Let the final model earn claims proportionate to the evidence, even if its self-written recommendation was unusually persuasive.
Frequently asked questions
Does nested cross-validation remove every source of bias?
No. It separates tuning from outer evaluation only if the full selection process is nested. Dependence, inappropriate grouping, selection of datasets and adaptation to outer results remain separate concerns.
Should I deploy the best outer-fold model?
Not by default. Apply the predefined selection and fitting procedure to the full development set. Selecting the best outer-fold checkpoint uses evaluation outcomes for another selection decision.
Can I average outer-fold accuracies?
Yes, when that average matches the intended weighting. Equal-fold, equal-scene and pooled-observation averages can estimate different quantities; state which one is reported.
References and further reading
- Cawley and Talbot (2010): On Over-fitting in Model Selection and Subsequent Selection Bias in Performance Evaluation
- Varma and Simon (2006): Bias in error estimation when using cross-validation for model selection
- Ambroise and McLachlan (2002): Selection bias in gene extraction on the basis of microarray gene-expression data
- Bengio and Grandvalet (2004): No Unbiased Estimator of the Variance of K-Fold Cross-Validation
- Varoquaux (2018): Cross-validation failure: small sample sizes lead to large error bars
Reader feedback
Reads since 1 October 2026: at least 15 seconds with the article visible, counted once per browser per day. Reactions are anonymous and can be changed.
Loading reader feedback…
Discuss this article
Ask a technical question, challenge an assumption or share evidence from your own work.