Skip to content

Did the test set really leave the development world?

Tonight · ~20 min · read · energy: low · setup: none

This lesson gathers Chapter 4’s leakage and testing-type material into the reading question that decides whether a paper’s performance number is honest. The whole appraisal turns on it: if the test set did not truly leave development, every downstream metric is optimistic.

The anchor: “external” is not a synonym for “honest”

A paper says “externally validated on dataset X”. That licenses a generalisation claim only if (a) the model was frozen when it met X, (b) no cohort-level step leaked X into development, and (c) the threshold was not re-estimated on X. Fail any of those and “external” describes the data’s origin, not the experiment’s honesty. The Tran et al. dissection (lesson 8) is the canonical example: the abstract’s flattering external numbers were partly retrained, with per-dataset thresholds — so “external validation” licensed a narrower claim than the headline.

The leakage reading-list

Carry Chapter 4’s catalogue as reading questions:

  • Patient/slice/scan leakage — did any patient’s data appear in both train and test? (The unit of analysis lesson, lesson 2.)
  • Preprocessing leakage — were scalers, feature selection, ComBat, imputation, or PCA fit on the whole cohort, including test? (Ch. 4.)
  • Hyperparameter leakage — were hyperparameters tuned on the outer test set rather than inside nested CV? (Ch. 4.)
  • Segmentation leakage — if the model consumes masks, were those masks produced by a segmentation model trained on overlapping patients?

Testing type, read precisely

Use precise terms (Ch. 4):

  • Internal testing — held-out from the same source. Lower bar; within-distribution.
  • Temporal testing — later data from the same source; catches drift.
  • External testing — independent cohort; the stronger claim.

And the frozen-vs-retrained distinction, which is the single most abused:

Separate “does the frozen model travel?” (frozen weights, frozen threshold) from “can the method be transferred after seeing the new domain?” (retrained). The abstract will often report the more flattering, retrained number.

A threshold re-estimated on the external set is itself a form of adaptation — the “external” operating point was fit to the new data. Read thresholds as carefully as weights.

What this licenses

The performance number licenses a claim only as wide as the test that produced it. Internal testing licenses within-distribution generalisation; frozen external testing licenses travel to a new site; retrained external testing licenses transfer-after- adaptation. “Generalisable” without specifying which is overclaim (lesson 6).

Stop and think — then reveal

A paper reports “external validation AUROC 0.92” and, in the methods, that the model was fine-tuned on the external dataset’s training split before testing on its test split, and that the operating threshold was chosen on that external test split. What two claims is the paper not entitled to make from this number?

  1. “The frozen model travels” — it does not; the model was fine-tuned on the external domain, so 0.92 measures transfer-after-adaptation, not raw travel.
  2. “This is the operating performance at a pre-specified threshold” — it is not; the threshold was chosen on the external test split, so the operating point was fit to the very data being reported (a mild but real leakage). The number is honestly characterised as “retrained-and-threshold-tuned performance on the external site”, which is a much narrower claim than “externally validated generalisation”. The abstract’s “external validation AUROC 0.92” overstates it.

What to retain

  1. “External” describes data origin, not experiment honesty — check frozen weights, no leakage, and a frozen threshold.
  2. Carry the leakage catalogue (patient/preprocessing/hyperparameter/segmentation) as reading questions.
  3. Read testing type precisely (internal/temporal/external) and the frozen-vs- retrained distinction; thresholds re-estimated on the test set are adaptation.
  4. A performance number licenses a claim only as wide as the test that produced it.

Next: assuming the number is honest — do the metrics support the clinical claim?