Why the Nominal Sample Size Can Mislead
A multi-omics prediction study may measure thousands of features on a few dozen people. The table can look large because it contains many columns, repeated samples, or technical replicates, but those do not necessarily provide many independent observations of the outcome. A model can then fit accidental patterns in the development data, and its estimated performance can vary substantially when a few subjects change.
Two related problems need to be distinguished. Limited effective sample size means there is less independent outcome information than the row count suggests. Optimistic performance estimation means the reported score is biased upward, often because many models, feature sets, or analysis choices were compared and the best result was reported. Limited data make this selection effect especially consequential, but they are not the same problem: an independent evaluation can estimate the performance of a selected model without reusing the selection data, although the estimate may still be imprecise.
The relevant independent unit depends on the intended use. If the goal is to predict outcomes for new patients, patients—not aliquots, assay runs, or longitudinal records—are usually the independent units for assessing generalization. If patients are grouped by site or family, observations within a group may share outcome-relevant information. Evaluation should respect the intended prediction target and the dependence structure. Earlier material on held-out performance and population shift addresses how the evaluation target and split strategy affect interpretation.
A useful special case is a sample made up of \(G\) equally sized clusters, each with \(m\) observations, where observations in a cluster have common pairwise correlation \(\rho\), and distinct clusters are independent. For estimating an overall mean, the variance inflation relative to \(n=Gm\) independent observations is the design effect \(1+(m-1)\rho\). The corresponding approximate effective sample size is:
This formula assumes equal cluster sizes and exchangeable within-cluster correlation; it is not a universal correction for every prediction problem. It illustrates why multiplying measurements per person does not multiply independent information. In classification, the numbers of independent subjects in each outcome class also matter: a cohort with many subjects but very few cases can have little information for estimating case performance.
Worked Example: Repeated Samples and Effective Sample Size
Suppose a hypothetical study has 30 patients, with 4 repeated specimens per patient, for 120 rows. Assume, for illustration, that the within-patient correlation is \(\rho=0.60\), and that patients are independent. What effective sample size does the equal-cluster formula give for an overall mean?
There are \(G=30\) clusters and \(m=4\) observations per cluster. The design effect is \(1+(m-1)\rho=1+3(0.60)=2.80\). Thus:
The 120 measurements provide about 42.9 independent-observation equivalents for estimating a mean under these assumptions, not 120. This calculation does not mean the prediction study has 42.9 independent patients: it has 30. For prediction to new patients, splitting specimens from one patient across training and evaluation sets would also fail to test generalization to independent patients.
How Extensive Search Produces Optimism
Suppose a researcher tries many feature subsets, preprocessing choices, and hyperparameter settings, then reports the largest cross-validated score. Even if all candidates have the same true performance, their estimated scores will differ because of sampling noise. Selecting the maximum tends to select a candidate whose noise happened to be positive. The more candidates searched, the more opportunity there is for such a favorable fluctuation.
A simple idealized calculation makes the mechanism clear. Let \(S_j=\theta+\varepsilon_j\) be the estimated score for candidate \(j\), where every candidate has the same true score \(\theta\), and the errors \(\varepsilon_j\) are independent \(N(0,\sigma^2)\). The selected score is \(\max_j S_j\). Its probability of being below a threshold \(t\) is:
Here \(M\) is the number of candidates and \(\Phi\) is the standard normal cumulative distribution function. Because the maximum is at least as large as each individual score, its expected value exceeds \(\theta\) when \(M>1\). In the idealized independent normal case, the expected maximum error grows approximately as \(\sigma\sqrt{2\log M}\) for large \(M\). This is an explanation of the direction and scale of the effect, not a universal correction: candidate scores are often correlated, and the normal approximation may not describe a particular metric.
Worked Example: Searching Many Noisy Candidates
In a hypothetical study, 100 candidate pipelines have the same true area under the ROC curve of 0.70. Suppose their internal evaluation errors are independent and approximately normal with standard deviation 0.04. What does the large-\(M\) approximation suggest about the score of the selected candidate?
Using \(M=100\), the approximate expected maximum error is:
Under this deliberately simplified approximation, the selected score could be around \(0.70+0.121=0.821\), despite every candidate having true score 0.70. The number is not a correction to apply to an actual analysis: the assumptions are strong, and bounded scores, correlated candidates, and data-dependent search alter the result. The valid conclusion is that selecting the best from many noisy estimates can make that selected estimate optimistic. Tuning procedures must account for the entire search, and a test set must not be reused to choose among candidates.
High dimensionality contributes to instability because many features can offer accidental associations when the number of independent subjects is small. It does not imply a single universal rule such as “the number of subjects must exceed the number of features.” Regularization, biological structure, measurement quality, and the prediction target all matter. But feature selection performed on the full data before evaluation, or repeated informal experimentation with the same evaluation results, can add selection optimism. Earlier material on tuning without optimism and protecting a held-out test set provides the relevant evaluation principles; the key point here is that limited independent information makes noisy comparisons more vulnerable to selection.
Using Learning Curves to Diagnose Data Limitations
A learning curve shows how estimated predictive performance changes as the number of training subjects increases. It can help distinguish a model that may benefit from more independent data from one whose performance appears to have levelled off. It cannot prove that a particular future sample size will deliver a particular score.
To make the curve informative, use the same target population, outcome definition, performance metric, and evaluation design at each training size. Draw training subsets at several sizes, fit the entire pipeline using only each subset, and evaluate it on subjects not used in that fit or in any data-dependent selection. If tuning is part of the intended pipeline, repeat tuning within each training subset. Use independent subjects as the unit for the sizes; adding more measurements on existing people is not equivalent to increasing the number of independent training subjects.
Repeat the subset sampling or resampling procedure to show variability, rather than interpreting a single jagged curve as a trend. For a metric where larger values are better, a curve that is still improving at its largest training sizes suggests that more data could help. A curve that levels off at modest performance suggests limited returns from simply adding similar data, though model specification, measurement quality, and distribution shift remain possible explanations. A wide band at every size signals unstable estimates. A curve can be non-monotone in finite samples, especially when training subsets differ in class composition or the evaluation set is small.
Worked Example: Reading a Hypothetical Learning Curve
A hypothetical team evaluates a fixed prediction pipeline using repeated subject-level splits. At each training size, it averages the area under the ROC curve across repetitions; the same independent evaluation subjects are used for comparability. Suppose the results are:
| Training subjects | Mean evaluation area under the ROC curve | Standard deviation across repetitions |
|---|---|---|
| 40 | 0.68 | 0.09 |
| 80 | 0.73 | 0.07 |
| 160 | 0.77 | 0.05 |
| 240 | 0.78 | 0.04 |
From 40 to 80 training subjects, the mean score increases by \(0.73-0.68=0.05\); from 80 to 160 it increases by \(0.77-0.73=0.04\); and from 160 to 240 it increases by \(0.78-0.77=0.01\). The standard deviation across repetitions also falls from 0.09 to 0.04. This pattern is consistent with improvement and reduced instability as training size increases, with smaller gains at the largest size. It does not establish that performance has reached a true plateau: uncertainty remains, and the curve covers only the observed sample sizes and evaluation setting.
The interpretation depends on the evaluation being independent of fitting and selection at every training size. If the same subjects contribute to feature selection before the splits, or if the evaluation scores were used repeatedly to redesign the pipeline, the displayed curve can be optimistic and cannot diagnose generalization reliably.
Diagnostics, Alternatives, and Limitations
Warning signs of insufficient independent information include large changes in selected features or fitted predictions across resamples, wide variation in evaluation scores, very few independent subjects in one outcome class, and learning curves that are still rising at their largest training size. These are indicators, not automatic thresholds. The appropriate uncertainty calculation depends on the sampling and evaluation design; repeated scores from overlapping resamples are not independent observations just because they are listed separately.
Several responses address different parts of the problem:
| Approach | What it can help with | What it cannot do |
|---|---|---|
| Collect more independent, relevant subjects | Increase information and potentially reduce instability | Guarantee better performance if new subjects differ in important ways |
| Pre-specify a smaller search and use regularization | Reduce flexibility and opportunities for selection on noise | Replace independent evaluation or eliminate all uncertainty |
| Use a learning curve | Show how observed performance and variability change with training size | Prove an asymptotic performance level or extrapolate reliably far beyond observed sizes |
| Use resampling for evaluation | Make efficient use of a limited cohort when the design is appropriate | Create new independent subjects or remove optimism if the search is not accounted for |
A learning curve also has practical limits. Small evaluation sets can make scores noisy at every training size. If the evaluation set is fixed, the different points share evaluation subjects, so their errors are related; the curve’s points should not be treated as independent estimates when comparing them. If future deployment differs by site, time, or population, a curve based only on random splits from one cohort may not describe that shift. And if a pipeline is changed after inspecting the curve, the revised pipeline needs evaluation that accounts for that renewed selection.
A common mistake is to count every specimen as an independent subject and then argue that a large row count makes the model well supported. The correction is to identify the independent unit for the intended prediction, account for relevant clustering, and assess how many independent outcomes—especially minority-class outcomes—are available. Another mistake is to treat a high score among many tried pipelines as strong evidence of high true performance. A maximum is selected partly for favorable noise; report performance from an evaluation design that protects against that selection, and describe its uncertainty.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A study has 25 patients and 6 repeated samples per patient. Should its prediction training size be described as 150 independent patients? Explain.
- Under the equal-cluster formula, calculate the approximate effective sample size for 20 clusters of 3 observations each when \(\rho=0.50\).
- Why can the best score from 50 tried pipelines be optimistic even if none of the pipelines uses information from a future test set?
- A learning curve rises from 0.70 to 0.78 as training size grows, but the standard deviation across repetitions remains large. What can and cannot be concluded?
- Why is adding more features not, by itself, a solution to a small number of independent outcome-bearing subjects?
Solutions. (1) No. There are 25 patients; the 150 samples are repeated observations nested within them. For generalization to new patients, subjects must be separated between fitting and evaluation. (2) Here \(G=20\), \(m=3\), and \(n=60\). The design effect is \(1+(3-1)(0.50)=2\), so \(n_{\mathrm{eff}}\approx60/2=30\). This is an approximate mean-estimation equivalent under the stated cluster assumptions, not a claim that the study contains 30 patients. (3) The pipeline with the largest estimated score can be the one with the most favorable noise. Protecting a future test set prevents reuse of that test set but does not make the maximum of the search estimates unbiased. (4) The observed increase is consistent with benefit from more training subjects, but the large variability indicates instability. The curve alone does not prove the increase will continue or establish performance in another population. (5) Additional features do not create independent outcome observations; in a small sample they may instead offer more opportunities to fit chance associations.