Mathematics · Article
Prediction, overfitting and validation
Define what a prediction assessment estimates, derive training optimism and bias–variance identities, and evaluate the complete learning procedure. Examine cross-validation, leakage, selection, dependent observations, test uncertainty, population shift and the precise scope of predictive coverage.
Back to MathematicsAfter reading, you can
- Define prediction risk using an explicit population, loss, information cutoff and averaging unit.
- Distinguish the conditional risk of one fitted predictor from the average performance of a training procedure.
- Derive squared-error decompositions and fixed-design optimism with their moment, covariance and selection conditions.
- Design training, validation, test and nested assessment so every learned operation respects the split.
- Assess dependence, sampling uncertainty, finite candidate selection and population shift without extending a theorem beyond its assumptions.
- Separate predictive uncertainty and transport from causal conclusions, and retain an auditable evaluation history.
Specify the future decision before assessing a model
A prediction is a function of information available when the prediction must be made. Before choosing an assessment score, specify the response, the intended users or population, the prediction horizon and the information cutoff. Predicting a measurement for a new person differs from predicting another measurement for a person already observed. Tomorrow’s feature value cannot be used for a decision made today unless its availability is part of the stated task.
Let D denote the training data together with any algorithmic randomness being conditioned on, and let f_D be the resulting predictor. For a fresh pair (X,Y) from an intended distribution Q, define R_Q(D)=E_Q[ℓ(Y,f_D(X))|D]. Unless another scheme is specified, this new pair is independent of D. The distribution Q and loss ℓ are part of the target; a reported accuracy or error without them is incomplete.
The observation process determines what a dataset represents. A convenient record of hospital visits need not represent all patients, and repeated readings from one instrument need not be independent instruments. The average over recorded rows can put more weight on frequent visitors or longer measurement runs. Decide whether the desired average is over rows, people, sites, future time points or some other unit.
Use a baseline that could actually be deployed with the same available information. A last-observation forecast, a training mean or a scientifically established rule can expose whether a complicated procedure adds useful predictive value. Its assessment must use the same population, splitting protocol and loss as the proposed alternative. A higher in-sample fit score alone does not answer that comparison.
A loss determines which prediction is useful
Squared loss ℓ(y,a)=(y−a)² measures errors in squared response units and gives large discrepancies substantial weight. If Y is measured in kilograms, mean squared error has units kg² and its square root has units kg. Under a finite conditional second moment, the conditional mean minimizes expected squared loss. This is a property of that objective, not a universal definition of the best forecast.
Absolute loss |y−a| uses response units and is minimized by a conditional median. Asymmetric absolute loss can target a specified conditional quantile, for example when underprediction and overprediction have different consequences. A scientific or operational decision should explain the asymmetry rather than selecting a loss because it makes the reported number favorable.
A percentage error may be unstable or undefined near a zero response; a relative improvement depends on the chosen baseline. Comparing MSE values across differently scaled targets is also misleading without a stated normalization. Any normalization learned from data belongs inside the training portion used for that assessment. Taking the square root of an estimated MSE changes the scale but does not preserve an exact unbiasedness claim.
Weights require a target interpretation. Equal row weights, equal person weights and population sampling weights generally define different risks. Write the numerator and denominator of an empirical score and state which future unit its average represents. A weighting choice does not, by itself, establish independence or repair an unrepresentative observation process.
A fitted rule and a training procedure have different risks
Conditional risk R_Q(D) fixes the realized training data and fitted rule and averages over a new outcome. Algorithm-average risk E_D[R_Q(D)] also averages over hypothetical training datasets drawn under the declared training law. A randomized learner can be handled by including its seed in D or by explicitly averaging over the seed. State which convention is being used.
Training sample size belongs to the procedure. A model fitted to m observations and the same algorithm fitted to n observations need not have the same average risk. A validation procedure that repeatedly trains on fewer than n rows therefore has a different natural target from a predictor finally fitted to all n rows. A learning-curve argument can relate them only under additional evidence or assumptions.
Even when a score is unbiased for an algorithm-average risk, it need not closely estimate the conditional risk of the particular fit now in hand. The distinction is especially relevant when training outcomes strongly affect the fitted predictor. A statement about average performance over hypothetical datasets is not a confidence interval for every realized model.
Bates, Hastie and Tibshirani distinguish these targets in their analysis of cross-validation. Here each exact identity states its own expectation and conditioning explicitly. This avoids using the word error for training residuals, a fresh prediction loss, a procedure-average risk and an assessment score as though they were the same quantity.
Derive the squared-error decomposition at a fixed feature value
Fix x and write m(x)=E[Y|X=x] and v(x)=Var(Y|X=x). Assume a fresh response is independent of the training procedure conditional on this x, and that all required second moments are finite. If μ_f(x)=E_D[f_D(x)], expand Y−f_D(x) as [Y−m(x)]+[m(x)−μ_f(x)]+[μ_f(x)−f_D(x)].
The centered terms have zero expectation, and independence makes their cross term vanish. Thus E_D,Y[(Y−f_D(x))²|X=x]=v(x)+[μ_f(x)−m(x)]²+Var_D(f_D(x)). These are future-response variation, squared prediction bias and variation across training outcomes. Each term has squared response units. Averaging over a feature distribution requires the corresponding integrability.
For one realized predictor, the training average has already been fixed. Its conditional new-response risk at x is v(x)+[f_D(x)−m(x)]². Do not add the ensemble predictor variance once more. Also, f_D(x)−m(x) is a deviation from the unknown conditional mean; it is not the residual from a single noisy response.
The decomposition is an exact accounting identity under its conditions. It does not prove that increasing model flexibility always lowers bias or always raises variance in every learning system. Regularization, feature construction, sample size and the training rule jointly affect the terms. Predictive noise is irreducible only relative to the specified information: a newly measured informative feature can change the conditional variance itself.
W1: ensemble versus a realized fitted prediction
Target: Squared prediction risk, with the averaging law and information set kept explicit.
Protocol: Compare an ensemble over training datasets/seeds with one fixed realized prediction at the same feature value.
Scope: Exact identities under the declared moment and independence premises; no fitted uncertainty or posterior probability is inferred.
Assumption: Fresh response and training procedure are independent conditional on the specified x. Required second moments exist.
Assumption: The realized deviation is from the true conditional mean, not an observed noisy residual.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Ensemble prediction risk | 7 | ≈7 | u squared. Average over training datasets/seeds and a fresh response at fixed x. |
| Realized-fit conditional risk | 13 | ≈13 | u squared. Average only the new response after fixing this prediction. |
| Squared ensemble bias | 1 | ≈1 | u squared. Bias relative to the true conditional mean. |
| Training prediction variance | 2 | ≈2 | u squared. Not added again after fixing the realized fit. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | ensemble-and-realized |
| label | W1: ensemble versus a realized fitted prediction |
| unit | u |
| kind | decomposition |
| noise | 4 |
| bias | 1 |
| trainingVariance | 2 |
| realizedDeviation | 3 |
| independent | true |
| finiteMoments | true |
| Declared quantity | Exact value [u squared] |
|---|---|
| Noise | 4 |
| Bias squared | 1 |
| Train variance | 2 |
| Declared quantity | Exact value [u squared] |
|---|---|
| Ensemble risk | 7 |
| Realized risk | 13 |
Why using a response both to fit and assess can look favorable
Condition on a fixed design of n feature rows. Let response vectors Y and Y′ be independent replicates with the same mean μ and covariance Ω, and let fhat=f(Y) be any fitted-vector rule with finite second moments. Compare T=||Y−fhat||²/n with F=||Y′−fhat||²/n. The second score predicts fresh responses at these same feature rows; it is not automatically a random-new-feature risk.
Expanding both squared norms cancels ||fhat||². Equal response second moments cancel the remaining norm terms. Independence gives E[Y′ᵀfhat]=μᵀE[fhat], whereas E[Yᵀfhat]=μᵀE[fhat]+ΣCov(Yᵢ,fhatᵢ). Therefore E[F−T]=(2/n)ΣCov(Yᵢ,fhatᵢ). The covariance quantifies how fitting adapts to the very responses used in T.
This identity allows nonlinear and selected rules, provided the moment and replicate conditions hold. Evaluating its covariance is then a separate problem. If the fitting rule depends on Y, it is generally invalid to replace its covariance by a nominal parameter count belonging to one of the models the rule might select. The selected procedure includes that response-dependent search.
The identity concerns an expectation, not a pointwise ordering of two observed scores. A particular fresh sample can look easier than the training sample. Likewise, a chosen rule need not have positive total covariance in every conceivable construction. The usual optimism of adaptive fitting has a precise covariance explanation without becoming a deterministic inequality for each dataset.
Trace corrections require the actual fitting operator
For a fixed, response-independent matrix S with fhat=SY, the total covariance is tr(SΩ). Consequently E[F−T]=2tr(SΩ)/n. Under Ω=σ²I this reduces to 2σ²tr(S)/n. A nonsymmetric matrix is allowed in this covariance calculation; the training rule and covariance must still be fixed as assumed.
Let B=||(I−S)μ||²/n. Direct expansion yields E[T]=B+tr((I−S)ᵀ(I−S)Ω)/n and E[F]=B+tr(Ω)/n+tr(SᵀSΩ)/n. These formulas distinguish the bias, residual-noise trace and fresh prediction-noise trace. With homogeneous covariance, the relevant traces are tr((I−S)ᵀ(I−S)) and tr(SᵀS), which need not equal n−tr(S) and tr(S).
For an OLS projection H onto a fixed feature space of actual rank r, Hᵀ=H and H²=H, so tr(H)=tr(HᵀH)=r. If μ lies in that space and Ω=σ²I, expected training MSE is σ²(1−r/n), fresh same-X MSE is σ²(1+r/n), and their difference is 2σ²r/n. A misspecified mean adds the same B to both expectations.
Aliased columns do not create additional fitted directions. A six-column representation of a rank-four space uses r=4 in these projection identities. For a non-idempotent smoother, a fractional tr(S) can describe covariance adaptation under homogeneous errors, but it cannot simply be inserted into every unpenalized residual-df or Student t formula. Those references need their own derivation.
A corrected score remains tied to a specified target
For a fixed OLS space and known homogeneous variance σ², C_pred=(SSE+2σ²r)/n is unbiased for the procedure-average fresh same-X response risk. Subtracting σ² gives C_mean=SSE/n+2σ²r/n−σ², an unbiased estimate of E[||HY−μ||²/n]. These statements allow a mean component outside the fitted space; its projection bias remains in both targets.
The calculation requires finite second moments and the stated covariance, not a Gaussian response law. It does require a fixed projection and the genuine value of σ². With an independently justified variance estimate, one must account for how its expectation and use affect the claim. Estimating variance after searching many models is not automatically equivalent to knowing it.
More general SURE identities for smooth nonlinear rules use additional assumptions, commonly Gaussian noise and suitable differentiability and integrability. Likelihood information criteria have their own response model, target and approximation. A name such as Cp, AIC or effective degrees of freedom cannot replace stating the actual correction and what it estimates. Here the exact claims concern the displayed fixed-operator identities.
Choosing the lowest corrected score among many candidates adds a selection step. Each candidate score can have a valid expectation while the reported minimum is optimistically selected. The conditional risk of that winner, a random-X target and a final all-data refit are further distinct objects. Record the search and assess the complete rule when that rule is what will be deployed.
W2: fixed rank-three projection on eight rows
Target: Procedure-average training and independent fresh-response loss at the same fixed feature rows.
Protocol: Retain the actual operator/rank and covariance in each trace, instead of substituting a nominal parameter count.
Scope: Exact finite second-moment expectation identities; Gaussianity is not required. A response-dependent search needs its own covariance calculation.
Assumption: The fitted operator is fixed independently of responses. Fresh and training response vectors are independent replicates with the same finite mean and covariance.
Assumption: These identities do not automatically assess a final selected fit or a new-feature population.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Expected training MSE | 5/2 | ≈2.5 | u squared. Fixed-design expectation including any stated projection bias. |
| Expected fresh same-X MSE | 11/2 | ≈5.5 | u squared. Independent response replicate at the same feature rows. |
| Expected optimism | 3 | ≈3 | u squared. 2 sigma² times actual rank divided by n. |
| Observed fresh-response corrected score | 5 | ≈5 | u squared. (SSE+2 sigma²r)/n estimates a procedure-average same-X response target. |
| Observed mean-estimation corrected score | 1 | ≈1 | u squared. Subtracts known response variance; negative realizations are allowed. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | known-projection-rank |
| label | W2: fixed rank-three projection on eight rows |
| unit | u |
| kind | projection |
| n | 8 |
| rank | 3 |
| sigma2 | 4 |
| biasRisk | 0 |
| sse | 16 |
| fixedRule | true |
| knownVariance | true |
| Declared quantity | Exact value [u squared] |
|---|---|
| Training E | 5/2 |
| Fresh E | 11/2 |
| Declared quantity | Exact value [u squared] |
|---|---|
| Observed train | 2 |
| Response Cp | 5 |
| Mean score | 1 |
Flexibility changes a procedure, not just a parameter count
For two fixed nested linear feature spaces fitted by unpenalized least squares to the same responses, enlarging the space cannot increase the minimized training SSE. The old fitted vector remains available in the larger space. This geometric fact says nothing by itself about the fresh risk, because fitting additional directions can absorb response noise as well as useful signal.
Regularization trades the fitted objective against a declared penalty. A fixed ridge rule is a linear smoother when its design and tuning value are fixed, while tuning that value using responses produces a more adaptive procedure. The correction for a fixed smoother cannot be reused without accounting for that search. A penalty can also change the interpretation of a coefficient or which correlated features share a fitted contribution.
A learning curve relates assessment to training sample size under a specified procedure and population. Include preprocessing and tuning in that procedure. Its realized scores can fluctuate, and its expected risk need not decrease monotonically for every rule or every sample size. Using the curve to extrapolate from fold-training size to an all-data refit is an additional modeling step, not an automatic property of cross-validation.
Compare scientifically meaningful capacities and baselines using a common assessment design. Report the search range, resource or measurement constraints and whether the selected representation remains usable at prediction time. A very low training loss or a large sample-to-parameter ratio cannot alone establish that the deployed rule will generalize.
Separate learning decisions from an untouched assessment
Training data fit a candidate rule. Validation data guide choices such as representation, tuning, stopping or candidate selection. A test set assesses a procedure whose relevant choices were frozen independently of its outcomes. These names describe information flow rather than a particular required ratio of sample sizes. A small but untouched test set can be honest and imprecise at the same time.
Every decision influenced by validation is part of the learned procedure. Repeatedly inspecting a test score and changing features, thresholds or code turns that test information into selection information. Renaming the same rows test again does not restore independence. Keep a record of which outcomes influenced which choices, including decisions made by a person after seeing a plot.
After a final assessment, refitting on additional labeled data changes the fitted predictor. A test statement for the old frozen predictor does not automatically transfer to the new realization. It can still inform an argument about a declared training procedure, with its target and training-size limitations stated. Do not describe that argument as a direct untouched test of the new fit.
When data are scarce, a carefully designed resampling procedure can use observations efficiently while maintaining the required separation within each split. This does not manufacture a new independent dataset. Keep the intended final deployment procedure clear, including whether its hyperparameters are frozen or selected again when new training data arrive.
Write down which fit predicts each held-out observation
Partition the row indices into disjoint nonempty folds I₁,…,I_K. For each k, fit the entire declared algorithm using only rows outside I_k and predict the rows inside it. The per-observation score is CV=(1/n)Σ_kΣ_{i∈I_k}ℓ(Yᵢ,f_{−k}(Xᵢ)). Equivalently it is Σ_k(|I_k|/n) times that fold’s mean loss. A fold must not help learn the rule being used to predict it.
With iid rows, fixed or independently chosen fold sizes, a fold partition drawn independently of the entire dataset (features and responses), and a fixed symmetric training algorithm, a held-out row is independent of its fold-training data. Conditional on the chosen partition, its expected loss concerns that algorithm trained on n−|I_k| iid observations. Equal fold sizes give a common smaller-training-size target; unequal sizes give the corresponding row-weighted mixture. A split learned from features or labels needs its own distributional argument; response independence alone is insufficient. None of these identities automatically makes the target the risk of the fully trained realized fit.
An unweighted mean of fold means instead gives each fold equal weight. It agrees with the per-row score when folds have equal size, but can differ substantially otherwise. Neither weighting is universally correct: declare whether rows, groups or folds are the intended units. Unequal group sizes make this issue visible even when the group split itself is appropriate.
Random splitting can be useful for an iid task, but it can misrepresent a task involving a new site, an unseen person or a future period. Stratifying labels may stabilize a split without correcting a dependence or transport problem. Preserve both the split construction and the precise reason it matches the intended prediction question.
Leave-one-out predicts with a smaller fitted record
Leave-one-out uses n fits, each withholding one row. For a fixed identified OLS fit whose row deletions retain rank, the preceding diagnostics lesson derived the deleted residual eᵢ/(1−hᵢ). PRESS is the sum of their squares. Reuse that identity with its hᵢ<1 condition; an essential hᵢ=1 row has no identified ordinary deleted prediction under the same coefficient representation.
The shortcut evaluates the fixed feature rule. If feature selection, a transformation, a tuning value or an exclusion rule is relearned on deletion, the new fitting procedure may require an actual refit. Applying the original fixed-H shortcut while leaving the response-selected features untouched evaluates a different procedure from rerunning that selection.
For an intercept mean trained on m iid observations with a common finite variance σ², fresh squared risk averaged over training is σ²+σ²/m. A leave-one-out score from n rows targets training on n−1 rows, giving σ²n/(n−1). A fully trained mean has average risk σ²(n+1)/n. Their difference is σ²/[n(n−1)] in this particular model.
That positive difference follows from this specified mean estimator and population. It does not establish that every cross-validation method has a universally positive bias for every fully trained algorithm, or that the score closely estimates a particular full fit’s conditional risk. Computational convenience, training size and the risk target remain separate questions.
The outer split must assess the selection rule itself
Suppose the intended learner chooses a configuration by an inner validation procedure. In each outer training portion, repeat that entire inner procedure, including preprocessing, candidate fitting and the selection rule. Refit the chosen configuration on that outer training portion as specified, then evaluate it on the untouched outer portion. Outer labels cannot choose the configuration they assess.
The outer scores concern the procedure that performs inner selection with the available outer training size. Different outer splits may select different configurations; that is part of what is being assessed. Combining their losses does not magically evaluate the conditional risk of a single final configuration fitted to all observations.
If the outer results themselves guide a new search, they have become selection information too. An account should identify the extra stage and preserve the search history. Nested splitting protects the declared boundary; it does not eliminate finite-sample variation, dependence between outer scores, a mismatched target population or scientific measurement defects.
Cawley and Talbot, and Varma and Simon, explain why optimizing a noisy assessment criterion can distort a reported assessment. The worked table below illustrates the distinction between selected inner scores and untouched outer losses. Its numerical gap is a stipulated example, not a theorem giving the direction or magnitude of bias on every dataset.
Learn every data-dependent operation inside its training boundary
A predictive pipeline includes imputation, centering, scaling, feature construction, target encoding, dimension reduction, feature selection, tuning and stopping, whenever those steps are learned from data. In an assessment of an inductive learner, fit each learned step using the corresponding training portion, then apply the frozen transformation to the held-out portion. Labels used for supervised feature selection are training information even if the final regression has not yet been fitted.
An outcome-derived feature can reveal a held-out response without looking like a conventional response column. Examples include a target mean computed using the held-out row, a downstream measurement obtained after the event being predicted, or a summary built after follow-up completes. Record when each feature becomes available and which records contribute to its calculation.
Some settings deliberately allow access to an unlabeled target feature collection before prediction; that is a transductive task with a different information set. It should be stated and assessed as such. The issue is whether the evaluation matches the claimed deployment procedure, not a blanket assertion that every use of unlabeled features creates the same bias.
Software pipelines can help enforce fitted-step boundaries, but they cannot determine the scientific unit, whether a timestamp is available or whether a label-derived database field leaks the answer. Inspect the provenance of the actual variables. A clean training/test index array is insufficient when a feature was already computed from the combined outcomes.
An unbiased candidate score does not make its minimum unbiased
Let two candidate rules have true risk 5, and suppose their assessment scores are 5+Z and 5−Z, where Z is equally likely to be 2 or −2. Each score has expectation 5. Selecting the smaller always reports 3, although the selected true risk remains 5. This joint law proves how selection can favor a favorable assessment fluctuation.
The example requires neither independent candidate scores nor a universal cross-validation distribution. Correlation, search size and the way the candidates are constructed all matter. Reporting only the selected score hides the procedure that produced it. The remedy is to assess the full selection rule or to use an appropriately justified simultaneous or selection-aware argument.
Repeated informal changes after viewing a holdout make the candidate family adaptive to it. Counting only the final few surviving models does not count the original search. A finite-family guarantee established for models fixed independently of the test labels cannot simply be applied to newly invented models that use those labels.
This also applies to manual decisions about plots, exclusions and threshold choices. Preserve versions and the order in which evidence was seen. A new untouched assessment may be needed for the revised rule, but no amount of relabeling can make already-used information independent again.
Match the split to the future unit and time direction
For prediction on new people or sites, keep all observations from each held-out unit out of the corresponding training process. Randomly assigning rows can otherwise put the same person’s stable characteristics or the same site’s measurement signature on both sides. Group separation changes the task to new-group prediction; it does not automatically decide how groups should be weighted.
When predicting later outcomes using earlier information, training labels and features must be available by the forecast origin. Rolling or expanding-window assessment can express that constraint. A label referring to an outcome two days ahead becomes available only after those two days; a training origin that looks earlier in a table can still contain future information.
A gap between training and assessment may address overlapping labels or a specified dependence horizon. Its length must follow the actual information and dependence argument. A gap does not prove independence, stationarity or that the future regime resembles the past. Uncertainty calculations and distribution-shift claims need their own support.
For dependent units, report the number of independent groups or periods justified by the design, rather than treating every sensor reading as an independent replication. A target that conditions on an already observed person differs from one that samples a new person. The appropriate split and interpretation can change even when the stored rows are identical.
An untouched test set supports a stated repeated-sampling claim
Fix a predictor independently of an iid test sample from Q, or condition on its independent training data and seed. Let Lᵢ=ℓ(Yᵢ,f_D(Xᵢ)) have finite expectation. Then the test mean Lbar is unbiased for this fitted predictor’s conditional risk R_Q(D). With finite loss variance, Var(Lbar|D)=Var(Lᵢ|D)/n. A normal approximation additionally needs the relevant asymptotic argument and an adequate sample; it is not an exact finite-sample law for arbitrary losses.
For losses in [0,1], Hoeffding’s bound gives P(|Lbar−R_Q(D)|≥ε|D)≤2exp(−2nε²). One derivation uses g(λ)=log E[exp(λ(L−E[L]))]. Under exponential tilting, g″ is the variance of a variable still in [0,1], so g″≤1/4; since g(0)=g′(0)=0, integration gives g(λ)≤λ²/8. Independence adds these bounds over test observations.
Markov’s inequality bounds the upper tail by exp(−nλε+nλ²/8). Choosing λ=4ε gives exp(−2nε²), and the lower-tail argument gives the second term. Thus radius sqrt(log(2/δ)/(2n)) yields a simultaneous two-sided interval for this one fixed risk, intersected with [0,1], with coverage at least 1−δ over repeated independent test samples.
An arbitrary squared loss is unbounded, so this bounded-loss radius does not automatically apply to MSE. Clipping a loss creates a different target. Finite variance of a squared loss involves sufficiently controlled fourth-order prediction errors, not merely finite response variance. For a general bounded loss in [a,b], rescale to [0,1] and multiply the radius by b−a.
The sharp constant in this self-contained proof is not taken from the coarser concentration statement in the listed Berkeley notes. An interval describes a repeated-sampling construction under its conditions; it is not a posterior probability for a fixed risk after observing this dataset, and it does not cover a predictor changed using the test labels without an additional argument.
Share test observations while accounting for comparisons
When two independently trained, frozen predictors use the same test observations, compare paired losses dᵢ=ℓ(Yᵢ,f_A(Xᵢ))−ℓ(Yᵢ,f_B(Xᵢ)). Their mean targets R_A−R_B. The variance uses Var(d)=Var(L_A)+Var(L_B)−2Cov(L_A,L_B); treating the two test averages as independent discards that covariance. Independence is required across the test units for an iid-unit calculation, not between two predictions on the same unit.
Suppose M candidate functions are all fixed independently of a common iid test set, and each has loss in [0,1]. Apply the preceding bound to each function and then a union bound. With probability at least 1−δ, all their empirical risks are within ε_M=sqrt(log(2M/δ)/(2n)) of their corresponding risks. The candidate functions and their losses need not be mutually independent.
On that simultaneous event, any index selected from this fixed family using the test scores also has a valid bound. If j minimizes empirical risk, then R_j≤min_i R_i+2ε_M. This conclusion follows by applying the common error bound once to the selected member and once to a true best member. It does not make the selected empirical score unbiased.
The family must be the one fixed before seeing test outcomes, with M counting every candidate in the claim. A procedure that creates a new model after inspecting those outcomes is outside this finite-family premise. For a continuous tuning range, adaptive exploration or many changing endpoints, an additional complexity or selection argument is needed; substituting the number of final survivors is insufficient.
W10: simultaneous bound for the original twenty-function family
Target: A frozen member or selection within a declared finite test-independent family.
Protocol: Use the two-sided Hoeffding bound and a union bound for all fixed M functions. All displayed decimals are approximations to the stated analytic expressions.
Scope: Coverage at least1−delta over repeated test sampling, conditional on independent training; not a posterior interval or an unbounded-MSE guarantee.
Assumption: The true loss lies in the stated bounded range, and test units are iid and independent of the fixed trained functions.
Assumption: Family size M counts the entire family fixed before test outcomes; functions need not be mutually independent.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Observed mean loss | 1/5 | ≈0.2 | dimensionless. One actual supplied empirical score; its unknown true risk is not plotted as a known point. |
| One-function radius | 1*sqrt(log(2/(1/20))/(2*200)) | ≈0.096032279132 | dimensionless. Two-sided single-function analytic radius. |
| Simultaneous family radius | 1*sqrt(log(40/(1/20))/(2*200)) | ≈0.129273080412 | dimensionless. Union-bound radius for every function in the original fixed family. |
| Guaranteed repeated-sampling level | 19/20 | ≈0.95 | probability. The analytic interval is intersected with the actual loss range. |
| Finite-family excess-risk bound | 2*(1*sqrt(log(40/(1/20))/(2*200))) | ≈0.258546160824 | dimensionless. For an empirical minimizer of the entire original fixed family: selected risk<=best true risk+2radius. It does not make the selected score unbiased. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | twenty-fixed-functions |
| label | W10: simultaneous bound for the original twenty-function family |
| unit | dimensionless |
| kind | hoeffding |
| n | 200 |
| familySize | 20 |
| delta | 1/20 |
| empiricalMean | 1/5 |
| lossLow | 0 |
| lossHigh | 1 |
| independentTest | true |
| familyFixed | true |
| iid | true |
| boundedLoss | true |
| selection | fixedFamilyMinimum |
| Item | Exact/analytic expression |
|---|---|
| Lower endpoint | max(0,1/5−(1*sqrt(log(40/(1/20))/(2*200)))) |
| Upper endpoint | min(1,1/5+(1*sqrt(log(40/(1/20))/(2*200)))) |
| Loss-axis origin | 0 |
| Loss-axis span | 1 |
Transport a risk only under explicit support and conditional-law assumptions
An assessment from source distribution P estimates source risk unless a transport argument connects it to the intended Q. Under covariate shift, assume Q_X is absolutely continuous with respect to P_X, the conditional law of Y given X is unchanged on the relevant support, and the predictor is fixed independently of the assessment sample. With known w(x)=dQ_X/dP_X, integrability gives R_Q(D)=E_P[w(X)ℓ(Y,f_D(X))|D].
The identity follows by first averaging the loss over the common conditional response law at x, then integrating against w dP_X=dQ_X. It does not hold for arbitrary changes in Y|X. If the target puts positive probability on a feature region never observed under P, an ordinary density ratio cannot recover its loss without an additional extrapolation or scientific assumption.
For independent source assessment rows and exact known weights, the ordinary mean of wᵢLᵢ is unbiased for the target risk. If E_P[(wL)²] is finite, its variance is [E_P[(wL)²]−R_Q(D)²]/n. Large or unstable weights can make this variance severe even when ordinary unweighted losses are bounded. Bounded raw loss does not imply bounded weighted loss.
The self-normalized ratio ΣwᵢLᵢ/Σwᵢ generally has finite-sample bias and is undefined when its denominator is zero. Under appropriate laws of large numbers and positive limiting denominator it can be consistent, which is different from exact unbiasedness. Estimated weights add their own sampling and modeling error; treating an estimated ratio as the exact known ratio does not preserve the original finite-sample calculation.
Assess overlap, measurement compatibility and plausible conditional stability alongside the numerical weights. A weighting method does not establish that a new hospital, instrument or future regime has the same outcome mechanism. Report which transport premise is supported, which is assumed and which regions remain unsupported.
W11: known weights and an actual three-row source record
Target: A specified target-population risk and the source information supporting it.
Protocol: Keep ordinary1/n weighting, self-normalization and clipping as different estimators/targets.
Scope: The transport/unbiasedness/variance claims require the declared support, conditional-stability and known-ratio premises.
Assumption: The predictor is fixed before independent source assessment. Exact known weights require Q_X<<P_X and an unchanged conditional Y|X law.
Assumption: The losses here are deterministic/source conditional mean losses in the declared finite example. Estimated probability ratios are not asserted to be true known weights.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Source risk | 3 | ≈3 | u squared. Exact average under the source law. |
| Supported weighted expectation | 5 | ≈5 | u squared. Sum over positive-source-probability categories only; not automatically the complete target risk. |
| Observed ordinary weighted mean | 58/9 | ≈6.44444444444 | u squared. Divide weighted loss sum by the number of actual source rows. |
| Observed sum of weights | 10/3 | ≈3.33333333333 | weight. Actual finite denominator, not replaced by its expectation. |
| Observed self-normalized ratio | 29/5 | ≈5.8 | u squared. Generally finite-sample biased; differs from ordinary1/n weighting. |
| Target risk under valid transport | 5 | ≈5 | u squared. Equals the supported weighted expectation under the stated finite known law. |
| One-row ratio undefined probability | 0 | ≈0 | probability. A source row with zero target weight gives0/0 in a one-row self-normalized ratio. |
| Expected one-row self-normalized ratio | 3 | ≈3 | u squared. With positive weights, the one-row ratio cancels the weight and averages source loss. |
| One-row ratio bias for target risk | -2 | ≈-2 | u squared. Exact finite-sample ratio bias in this specified model. |
| Variance of ordinary weighted mean | 169/9 | ≈18.7777777778 | u to fourth. For iid source rows and a fixed predictor under the exact known finite model. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | known-weighted-assessment |
| label | W11: known weights and an actual three-row source record |
| unit | u |
| kind | weighted |
| P | ["3/4","1/4"] |
| Q | ["1/2","1/2"] |
| losses | ["1","9"] |
| observedCategories | [0,0,1] |
| conditionalStable | true |
| weightStatus | known |
| clip | null |
| Category | P mass | Q mass | Source conditional loss | Q/P weight |
|---|---|---|---|---|
| X0 | 3/4 | 1/2 | 1 | 2/3 |
| X1 | 1/4 | 1/2 | 9 | 2 |
| Declared quantity | Exact value [probability] |
|---|---|
| P0 | 3/4 |
| Q0 | 1/2 |
| P1 | 1/4 |
| Q1 | 1/2 |
| Row | Category | Loss | Weight / weighted loss |
|---|---|---|---|
| 1 | X0 | 1 | 2/3 / 2/3 |
| 2 | X0 | 1 | 2/3 / 2/3 |
| 3 | X1 | 9 | 2 / 18 |
| Declared quantity | Exact value [u squared] |
|---|---|
| Ordinary mean | 58/9 |
| Weight ratio | 29/5 |
Coverage is another prediction task with its own data boundary
A mean squared assessment score is an average loss, not a prediction interval for a new response. To introduce a different kind of predictive guarantee, freeze a point predictor using a training portion. On a separate calibration portion of m observations, compute absolute scores sᵢ=|Yᵢ−f_D(Xᵢ)|. Suppose the calibration observations and the new observation are exchangeable conditional on that training and its fixed predictor.
For 0<α<1, set k=ceil((m+1)(1−α)). If k≤m, let q be the kth ordered calibration score; if k=m+1, set q=+∞. The closed prediction interval is [f_D(x)−q,f_D(x)+q]. Equality at q is included. The infinity rule explicitly completes this rank construction at its finite-calibration boundary rather than silently choosing the largest finite score.
To see the guarantee, first break ties among the m+1 exchangeable scores using independent continuous random tie breakers. The new score’s rank is uniform over 1,…,m+1, so its chance of rank at most k is k/(m+1)≥1−α. That rank event implies its unbroken score is no larger than the calibration kth score when k≤m. Inclusive ties can only enlarge the covered event. For k=m+1 the interval is the full response line.
This is marginal coverage over calibration and the new observation conditional on the independent training, not coverage at every feature x, in every subgroup, or conditional on the particular observed calibration set. A broad interval can satisfy coverage and still be unhelpful. The result does not establish a causal effect, protect arbitrary future distribution shift or validate a point model’s scientific mechanism.
Tuning the predictor, its score or an inclusion rule using these same calibration labels can invalidate the displayed exchangeability argument for the intended construction. More elaborate conformal methods require their own protocol and theorem. The listed Lei and colleagues paper supports split calibration and its marginal scope; the explicit +∞ boundary here is the lesson’s stated completion of the rank argument.
W12: exact eighth rank and a closed finite interval
Target: A closed split-conformal new-response interval, with marginal rather than conditional-on-x coverage.
Protocol: Compute the exact rational ceiling k=ceil((m+1)(1−alpha)); use the kth calibration score or the explicitly completed+infinity boundary.
Scope: Coverage is marginal over calibration and a new observation conditional on independent training; it is not conditional on the observed calibration set or every feature value.
Assumption: The point predictor is frozen using independent training. Calibration and the new observation are exchangeable conditional on that training.
Assumption: Absolute-score ties are included. Calibration labels do not tune the predictor, score or inclusion rule.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Calibration count | 9 | ≈9 | observations. Actual supplied calibration scores. |
| Exact selected rank | 8 | ≈8 | rank. Computed before any floating conversion or rounding. |
| Nominal coverage level | 4/5 | ≈0.8 | probability. The requested level, not an observed conditional probability. |
| Rank lower bound on marginal coverage | 4/5 | ≈0.8 | probability. Uniform randomized rank with inclusive unbroken ties; the event can be conservative. |
| Split threshold | 7 | ≈7 | u. The actual kth score, with equality included. |
| Closed interval lower endpoint | 3 | ≈3 | u. Exact finite response endpoint. |
| Closed interval upper endpoint | 17 | ≈17 | u. Exact finite response endpoint. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | finite-split-rank |
| label | W12: exact eighth rank and a closed finite interval |
| unit | u |
| kind | split |
| scores | ["1","2","2","3","4","5","6","7","9"] |
| alpha | 1/5 |
| prediction | 10 |
| exchangeable | true |
| trainedIndependently | true |
| calibrationUsedForTuning | false |
| Coordinate | Origin | Span |
|---|---|---|
| X | 1 | 8 |
| Y | 0 | 9 |
| Ordered rank | Absolute score | Threshold equality included |
|---|---|---|
| 1 | 1 | not at q |
| 2 | 2 | not at q |
| 3 | 2 | not at q |
| 4 | 3 | not at q |
| 5 | 4 | not at q |
| 6 | 5 | not at q |
| 7 | 6 | not at q |
| 8 | 7 | yes: tied at q |
| 9 | 9 | not at q |
| Coordinate | Exact origin | Exact display span |
|---|---|---|
| Response | 3 | 14 |
Investigate where prediction quality is fragile
A useful assessment includes plausible simple baselines, errors across scientifically relevant regions, and sensitivity to the declared training procedure. Stability asks how a fitted rule or its predictions change when the training information changes. Such sensitivity can matter for deployment even if one pooled mean score is favorable. The definition and perturbation scheme should be explicit.
Subgroup, site or horizon summaries help locate a concentration of large losses. Small subgroup samples can make these summaries noisy, and searching many subgroups after seeing outcomes adds selection. Do not turn a good global average into an unexamined promise for every group, or interpret a selected worst group without its uncertainty and search history.
Squared-loss improvements can be dominated by a few large errors; absolute loss, tail summaries and operational losses answer other questions. Preserve the primary objective and report complementary summaries for a reason. Deleting difficult rows because they worsen a score changes the assessed population unless a defensible observation rule was already part of the task.
A sensitivity analysis can vary plausible measurement errors, supported shifts or scientific assumptions. It does not prove robustness against every unexamined mechanism. Distinguish a stable numerical algorithm, a stable prediction under a particular perturbation and a scientifically transportable relationship; none is a substitute for the others.
Preserve the procedure that produced the score
Save the target population and unit, response and loss definition, feature availability rules, split assignments, seeds, preprocessing specification, candidate family, tuning rule and software configuration. Retain the fitted versions associated with reported predictions. A seed alone does not identify the data, code or information boundaries that produced them.
Store held-out predictions and losses at the appropriate permitted level so that weighting, pairing and aggregation can be checked. Protect private identifiers and data through the existing access rules. Document exclusions, missing outcomes and failures rather than dropping undefined predictions or difficult cases without accounting for them in the target.
Report which observations influenced candidate development, which influenced selection and which remained untouched for each stated claim. Give uncertainty under its actual assumptions and distinguish training-size limitations, source-population limitations and unsupported transport. A final refit should have its own identity, connected to the procedure assessed but not silently substituted for it.
A concise result can still carry this depth: state the future task, the complete fitted procedure, the assessment protocol and unit, the observed loss with justified uncertainty, and the material limitations. Reproducibility preserves how the conclusion was earned; a single favorable number cannot carry the missing experimental history.
Prediction assesses a task, not every interpretation of a relationship
In biology, sample preparation, patient repetition and site-specific measurement can make row-wise assessment overoptimistic for new individuals or laboratories. A supervised gene filter must be learned inside each relevant training split. The scientific meaning of a feature remains separate from whether it predicts well under that sampling process.
In economics and resource forecasting, time direction, policy changes and delayed outcomes determine the available information and the plausible target distribution. A future regime can change conditional responses as well as feature frequencies. Weighting a historical feature distribution does not establish stability of the response mechanism.
In computing and machine learning, the algorithm includes representation learning, tuning, stopping and any repeated use of a benchmark. A benchmark repeatedly used for development becomes part of the selection process. Fixed-family guarantees and untouched assessment remain useful only when their declared information boundaries are respected.
A predictor can exploit a stable association without identifying what would happen under an intervention. Randomized assignment, observational identification, confounding and transport of causal conclusions require additional arguments developed in the next lessons. Preserve the distinction between predicting Y from available X and estimating the effect of changing X.
The central habit is to name the object being assessed and every expectation supporting the claim. Conditional risk, algorithm-average risk, training loss, a validation criterion, a weighted source estimate and a marginal coverage statement can all be useful. They become scientifically misleading when one is presented as proof of another without the required bridge.
Specify the future unit, information boundary and averaging law. Each example retains its actual input, scope and any genuine held result. Changing a case computes only that selected family.
Which prediction risk is being averaged?
W1: ensemble versus a realized fitted prediction. Prepared under the explicitly stated conditions.
W1: ensemble versus a realized fitted prediction
Target: Squared prediction risk, with the averaging law and information set kept explicit.
Protocol: Compare an ensemble over training datasets/seeds with one fixed realized prediction at the same feature value.
Scope: Exact identities under the declared moment and independence premises; no fitted uncertainty or posterior probability is inferred.
Assumption: Fresh response and training procedure are independent conditional on the specified x. Required second moments exist.
Assumption: The realized deviation is from the true conditional mean, not an observed noisy residual.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Ensemble prediction risk | 7 | ≈7 | u squared. Average over training datasets/seeds and a fresh response at fixed x. |
| Realized-fit conditional risk | 13 | ≈13 | u squared. Average only the new response after fixing this prediction. |
| Squared ensemble bias | 1 | ≈1 | u squared. Bias relative to the true conditional mean. |
| Training prediction variance | 2 | ≈2 | u squared. Not added again after fixing the realized fit. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | ensemble-and-realized |
| label | W1: ensemble versus a realized fitted prediction |
| unit | u |
| kind | decomposition |
| noise | 4 |
| bias | 1 |
| trainingVariance | 2 |
| realizedDeviation | 3 |
| independent | true |
| finiteMoments | true |
| Declared quantity | Exact value [u squared] |
|---|---|
| Noise | 4 |
| Bias squared | 1 |
| Train variance | 2 |
| Declared quantity | Exact value [u squared] |
|---|---|
| Ensemble risk | 7 |
| Realized risk | 13 |
Fixed-operator optimism and risk corrections
W2: fixed rank-three projection on eight rows. Prepared under the explicitly stated conditions.
W2: fixed rank-three projection on eight rows
Target: Procedure-average training and independent fresh-response loss at the same fixed feature rows.
Protocol: Retain the actual operator/rank and covariance in each trace, instead of substituting a nominal parameter count.
Scope: Exact finite second-moment expectation identities; Gaussianity is not required. A response-dependent search needs its own covariance calculation.
Assumption: The fitted operator is fixed independently of responses. Fresh and training response vectors are independent replicates with the same finite mean and covariance.
Assumption: These identities do not automatically assess a final selected fit or a new-feature population.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Expected training MSE | 5/2 | ≈2.5 | u squared. Fixed-design expectation including any stated projection bias. |
| Expected fresh same-X MSE | 11/2 | ≈5.5 | u squared. Independent response replicate at the same feature rows. |
| Expected optimism | 3 | ≈3 | u squared. 2 sigma² times actual rank divided by n. |
| Observed fresh-response corrected score | 5 | ≈5 | u squared. (SSE+2 sigma²r)/n estimates a procedure-average same-X response target. |
| Observed mean-estimation corrected score | 1 | ≈1 | u squared. Subtracts known response variance; negative realizations are allowed. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | known-projection-rank |
| label | W2: fixed rank-three projection on eight rows |
| unit | u |
| kind | projection |
| n | 8 |
| rank | 3 |
| sigma2 | 4 |
| biasRisk | 0 |
| sse | 16 |
| fixedRule | true |
| knownVariance | true |
| Declared quantity | Exact value [u squared] |
|---|---|
| Training E | 5/2 |
| Fresh E | 11/2 |
| Declared quantity | Exact value [u squared] |
|---|---|
| Observed train | 2 |
| Response Cp | 5 |
| Mean score | 1 |
The unit and procedure being assessed
W6: row weighting differs from equal-fold weighting. Prepared under the explicitly stated conditions.
W6: row weighting differs from equal-fold weighting
Target: The declared held-out procedure, averaging unit and information boundary.
Protocol: Weight fold sums by actual held-out row counts; compare with equal-fold weighting.
Scope: Descriptive scores do not alone establish the conditional risk of a final all-data fit.
Assumption: Every held-out loss comes from a fit using only the other folds, including all preprocessing and tuning.
Assumption: The iid training-size interpretation additionally needs a partition independent of the entire dataset and a fixed symmetric learner.
Conditional on this independently chosen partition, the expected score is the row-weighted mixture of algorithm-average risks at training sizes n−|I_k|.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Row-uniform CV score | 23/6 | ≈3.83333333333 | u squared. Each actual held-out row has weight1/n. |
| Fold-uniform score | 14/3 | ≈4.66666666667 | u squared. Each fold mean has weight1/K. |
| Total held-out rows | 6 | ≈6 | rows. Not automatically the count of independent units. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | unequal-fold-means |
| label | W6: row weighting differs from equal-fold weighting |
| unit | u |
| kind | folds |
| sizes | [1,2,3] |
| meanLosses | ["9","1","4"] |
| partitionIndependent | true |
| algorithmFixed | true |
| iidRows | true |
| Fold | Held-out rows | Training rows | Mean loss |
|---|---|---|---|
| 1 | 1 | 5 | 9 |
| 2 | 2 | 4 | 1 |
| 3 | 3 | 3 | 4 |
| Declared quantity | Exact value [u squared] |
|---|---|
| Fold 1 | 9 |
| Fold 2 | 1 |
| Fold 3 | 4 |
| Declared quantity | Exact value [u squared] |
|---|---|
| Row uniform | 23/6 |
| Fold uniform | 14/3 |
Independent tests and finite-family selection
W10: simultaneous bound for the original twenty-function family. Prepared under the explicitly stated conditions.
W10: simultaneous bound for the original twenty-function family
Target: A frozen member or selection within a declared finite test-independent family.
Protocol: Use the two-sided Hoeffding bound and a union bound for all fixed M functions. All displayed decimals are approximations to the stated analytic expressions.
Scope: Coverage at least1−delta over repeated test sampling, conditional on independent training; not a posterior interval or an unbounded-MSE guarantee.
Assumption: The true loss lies in the stated bounded range, and test units are iid and independent of the fixed trained functions.
Assumption: Family size M counts the entire family fixed before test outcomes; functions need not be mutually independent.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Observed mean loss | 1/5 | ≈0.2 | dimensionless. One actual supplied empirical score; its unknown true risk is not plotted as a known point. |
| One-function radius | 1*sqrt(log(2/(1/20))/(2*200)) | ≈0.096032279132 | dimensionless. Two-sided single-function analytic radius. |
| Simultaneous family radius | 1*sqrt(log(40/(1/20))/(2*200)) | ≈0.129273080412 | dimensionless. Union-bound radius for every function in the original fixed family. |
| Guaranteed repeated-sampling level | 19/20 | ≈0.95 | probability. The analytic interval is intersected with the actual loss range. |
| Finite-family excess-risk bound | 2*(1*sqrt(log(40/(1/20))/(2*200))) | ≈0.258546160824 | dimensionless. For an empirical minimizer of the entire original fixed family: selected risk<=best true risk+2radius. It does not make the selected score unbiased. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | twenty-fixed-functions |
| label | W10: simultaneous bound for the original twenty-function family |
| unit | dimensionless |
| kind | hoeffding |
| n | 200 |
| familySize | 20 |
| delta | 1/20 |
| empiricalMean | 1/5 |
| lossLow | 0 |
| lossHigh | 1 |
| independentTest | true |
| familyFixed | true |
| iid | true |
| boundedLoss | true |
| selection | fixedFamilyMinimum |
| Item | Exact/analytic expression |
|---|---|
| Lower endpoint | max(0,1/5−(1*sqrt(log(40/(1/20))/(2*200)))) |
| Upper endpoint | min(1,1/5+(1*sqrt(log(40/(1/20))/(2*200)))) |
| Loss-axis origin | 0 |
| Loss-axis span | 1 |
Known weighting and target support
W11: known weights and an actual three-row source record. Prepared under the explicitly stated conditions.
W11: known weights and an actual three-row source record
Target: A specified target-population risk and the source information supporting it.
Protocol: Keep ordinary1/n weighting, self-normalization and clipping as different estimators/targets.
Scope: The transport/unbiasedness/variance claims require the declared support, conditional-stability and known-ratio premises.
Assumption: The predictor is fixed before independent source assessment. Exact known weights require Q_X<<P_X and an unchanged conditional Y|X law.
Assumption: The losses here are deterministic/source conditional mean losses in the declared finite example. Estimated probability ratios are not asserted to be true known weights.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Source risk | 3 | ≈3 | u squared. Exact average under the source law. |
| Supported weighted expectation | 5 | ≈5 | u squared. Sum over positive-source-probability categories only; not automatically the complete target risk. |
| Observed ordinary weighted mean | 58/9 | ≈6.44444444444 | u squared. Divide weighted loss sum by the number of actual source rows. |
| Observed sum of weights | 10/3 | ≈3.33333333333 | weight. Actual finite denominator, not replaced by its expectation. |
| Observed self-normalized ratio | 29/5 | ≈5.8 | u squared. Generally finite-sample biased; differs from ordinary1/n weighting. |
| Target risk under valid transport | 5 | ≈5 | u squared. Equals the supported weighted expectation under the stated finite known law. |
| One-row ratio undefined probability | 0 | ≈0 | probability. A source row with zero target weight gives0/0 in a one-row self-normalized ratio. |
| Expected one-row self-normalized ratio | 3 | ≈3 | u squared. With positive weights, the one-row ratio cancels the weight and averages source loss. |
| One-row ratio bias for target risk | -2 | ≈-2 | u squared. Exact finite-sample ratio bias in this specified model. |
| Variance of ordinary weighted mean | 169/9 | ≈18.7777777778 | u to fourth. For iid source rows and a fixed predictor under the exact known finite model. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | known-weighted-assessment |
| label | W11: known weights and an actual three-row source record |
| unit | u |
| kind | weighted |
| P | ["3/4","1/4"] |
| Q | ["1/2","1/2"] |
| losses | ["1","9"] |
| observedCategories | [0,0,1] |
| conditionalStable | true |
| weightStatus | known |
| clip | null |
| Category | P mass | Q mass | Source conditional loss | Q/P weight |
|---|---|---|---|---|
| X0 | 3/4 | 1/2 | 1 | 2/3 |
| X1 | 1/4 | 1/2 | 9 | 2 |
| Declared quantity | Exact value [probability] |
|---|---|
| P0 | 3/4 |
| Q0 | 1/2 |
| P1 | 1/4 |
| Q1 | 1/2 |
| Row | Category | Loss | Weight / weighted loss |
|---|---|---|---|
| 1 | X0 | 1 | 2/3 / 2/3 |
| 2 | X0 | 1 | 2/3 / 2/3 |
| 3 | X1 | 9 | 2 / 18 |
| Declared quantity | Exact value [u squared] |
|---|---|
| Ordinary mean | 58/9 |
| Weight ratio | 29/5 |
Finite calibration ranks and marginal coverage
W12: exact eighth rank and a closed finite interval. Prepared under the explicitly stated conditions.
W12: exact eighth rank and a closed finite interval
Target: A closed split-conformal new-response interval, with marginal rather than conditional-on-x coverage.
Protocol: Compute the exact rational ceiling k=ceil((m+1)(1−alpha)); use the kth calibration score or the explicitly completed+infinity boundary.
Scope: Coverage is marginal over calibration and a new observation conditional on independent training; it is not conditional on the observed calibration set or every feature value.
Assumption: The point predictor is frozen using independent training. Calibration and the new observation are exchangeable conditional on that training.
Assumption: Absolute-score ties are included. Calibration labels do not tune the predictor, score or inclusion rule.
| Quantity | Exact value/status | Finite approximation | Units and scope |
|---|---|---|---|
| Calibration count | 9 | ≈9 | observations. Actual supplied calibration scores. |
| Exact selected rank | 8 | ≈8 | rank. Computed before any floating conversion or rounding. |
| Nominal coverage level | 4/5 | ≈0.8 | probability. The requested level, not an observed conditional probability. |
| Rank lower bound on marginal coverage | 4/5 | ≈0.8 | probability. Uniform randomized rank with inclusive unbroken ties; the event can be conservative. |
| Split threshold | 7 | ≈7 | u. The actual kth score, with equality included. |
| Closed interval lower endpoint | 3 | ≈3 | u. Exact finite response endpoint. |
| Closed interval upper endpoint | 17 | ≈17 | u. Exact finite response endpoint. |
Fractions and stated expressions retain exact calculations. Marked decimals and native drawing coordinates are finite approximations. Exact plotting origins and spans remain in their tables. These figures distinguish observed scores, model expectations and justified guarantees.
Exact scientific input, plotting origins and supporting tables
| Field | Declared value |
|---|---|
| id | finite-split-rank |
| label | W12: exact eighth rank and a closed finite interval |
| unit | u |
| kind | split |
| scores | ["1","2","2","3","4","5","6","7","9"] |
| alpha | 1/5 |
| prediction | 10 |
| exchangeable | true |
| trainedIndependently | true |
| calibrationUsedForTuning | false |
| Coordinate | Origin | Span |
|---|---|---|
| X | 1 | 8 |
| Y | 0 | 9 |
| Ordered rank | Absolute score | Threshold equality included |
|---|---|---|
| 1 | 1 | not at q |
| 2 | 2 | not at q |
| 3 | 2 | not at q |
| 4 | 3 | not at q |
| 5 | 4 | not at q |
| 6 | 5 | not at q |
| 7 | 6 | not at q |
| 8 | 7 | yes: tied at q |
| 9 | 9 | not at q |
| Coordinate | Exact origin | Exact display span |
|---|---|---|
| Response | 3 | 14 |
Worked examples
Distinguish two legitimate squared-risk averages
At a fixed x, future-response variance is 4 u². Across independent training datasets and algorithm seeds, prediction bias is 1 u and prediction variance is 2 u². Find ensemble prediction risk. A particular realized prediction differs from the true conditional mean by 3 u; find its conditional fresh-response risk.
- Under the finite-moment and independent-future-response conditions, the ensemble decomposition gives 4+1²+2=7 u².
- For the particular fit, f_D(x)−m(x)=3 u is fixed. Averaging only the new response gives 4+3²=13 u².
- Adding the ensemble variance 2 u² to the second answer would average over training variation after the predictor has already been fixed. The two risks use different conditioning.
- The 3 u deviation is from the conditional mean, not a single observed residual. One noisy residual would not identify that deviation or the conditional risk.
Ensemble risk is 7 u²; the stated realized fit has conditional risk 13 u².
Compute a same-design correction using actual rank
An OLS projection has n=8 rows and actual rank r=3. The true mean lies in its fixed fitted space and the homogeneous error variance is known to be 4 u². Find expected training and fresh same-X response MSE. For an observed SSE of 16 u², compute the fresh-response and mean-estimation corrected scores.
- Idempotence gives expected training MSE 4(1−3/8)=5/2 u² and independent fresh same-X MSE 4(1+3/8)=11/2 u².
- Their expectation difference is 2·4·3/8=3 u². It accounts for covariance with training responses, not for a deterministic gap on each observed sample.
- The observed training score is 16/8=2 u², so C_pred=2+3=5 u². The corresponding mean-estimation score subtracts known response noise: C_mean=5−4=1 u².
- These observed scores estimate their procedure-average targets under the fixed-space assumptions. Neither is the exact conditional risk of this fitted rule or an assessment at arbitrary new feature values.
Expected training/fresh response risks are 5/2 and 11/2 u²; optimism is 3 u². The observed corrected scores are 5 and 1 u².
Separate covariance trace from residual-noise trace
In an orthonormal coordinate system, a fixed symmetric smoother has eigenvalues (1,1/2,0). Let n=3, μ=0 and Ω=3I u². Compute its expected training MSE, fresh same-X MSE and optimism.
- The trace is 3/2 and tr(SᵀS)=1+1/4=5/4. The residual operator has eigenvalues (0,1/2,1), giving tr((I−S)ᵀ(I−S))=5/4.
- There is no mean bias because μ=0. Expected training MSE is (3/3)(5/4)=5/4 u².
- Fresh response variation contributes 3 u² and fitted-noise variation contributes (3/3)(5/4)=5/4 u², totaling 17/4 u².
- The gap is 3 u², also 2·3·(3/2)/3. Using n−tr(S)=3/2 as though it were the residual-noise trace would give a different, incorrect training expectation.
Training risk 5/4 u², fresh risk 17/4 u² and optimism 3 u²; the two relevant quadratic traces equal 5/4.
Perfect training fit can lose to an available baseline
Training features are (−1,1) and the observed responses are (−1,1). In the stipulated population, X is uniform on {−1,1} and Y is an independent fair ±1 response. Compare the fixed zero predictor with the line fitted through the training observations.
- The observed response pattern has probability 1/4 at these training features. The zero predictor has training SSE 2, while the fitted line f_D(x)=x has training SSE 0.
- A fresh response has mean 0 and variance 1, independent of X and of this fixed realized fit. The zero rule therefore has fresh squared risk 1.
- For the realized line, E[(Y−X)²]=E[Y²]+E[X²]−2E[YX]=1+1=2. This is assessed on the same feature support, without any extrapolation.
- The example supplies an exact possible failure of training error as predictive evidence. It does not claim that every interpolating method or every larger model necessarily has higher risk.
The zero rule has training SSE 2 and fresh risk 1; the realized interpolating line has SSE 0 and fresh risk 2.
Separate an observed PRESS score from its population target
For the intercept-only response record (0,1,3,4), compute the fitted mean, SSE, training MSE and leave-one-out MSE. Separately, in an iid common-mean population of finite variance σ², compare expected fresh risk for a mean trained on three observations with that for a mean trained on four.
- The full mean is 2, residuals are (−2,−1,1,2), and SSE is 10. Training MSE is 10/4=5/2.
- Each leverage is 1/4. The retained PRESS identity gives deleted residuals (−8/3,−4/3,4/3,8/3), squared sum 160/9 and LOO mean loss 40/9.
- For a mean trained on m independent observations, fresh error is a fresh centered response minus an independent sample-mean error. Their variances add to σ²(1+1/m).
- Training sizes three and four therefore have average risks 4σ²/3 and 5σ²/4, with difference σ²/12. This theoretical σ² is separately stipulated; the observed SSE does not identify it exactly.
Observed mean 2, SSE 10, training MSE 5/2 and LOO MSE 40/9. The population training-size risk gap is σ²/12.
A row-uniform score differs from a fold-uniform score
Three held-out folds have sizes 1,2,3 and mean squared losses 9,1,4 u². Compute the pooled per-row score and the unweighted mean of fold means. State their averaging units.
- The total held-out loss is 1·9+2·1+3·4=23 u² across six observations.
- The per-row score is therefore 23/6 u². It gives every held-out observation equal weight.
- Giving the three folds equal weight instead yields (9+1+4)/3=14/3 u². The singleton fold receives one third of that score rather than one sixth.
- Neither number can be interpreted without the target unit. Here the fits also train on different numbers of rows, so their expectation is not automatically risk for a single common training size.
Per-row score 23/6 u²; equal-fold score 14/3 u².
Assess the rule that chooses a configuration
Two equally sized outer folds use an inner assessment to choose between A and B. In outer split 1, inner scores are (1,3), and the chosen fit has untouched outer loss 9. In split 2, inner scores are (4,2), and the chosen fit has outer loss 5. Compute the selected inner mean and the outer mean.
- The first inner search chooses A with score 1; the second chooses B with score 2. Configuration choice is allowed to differ across outer training portions.
- The mean selected inner score is (1+2)/2=3/2. Those scores were used for selection within the corresponding training portions.
- The untouched outer losses average to (9+5)/2=7. With equal outer sizes this is also the pooled per-row outer score.
- The outer evaluation concerns the procedure including inner selection at outer training size. The table gives no universal bias magnitude and no direct conditional-risk guarantee for a final all-data refit.
Selected configurations are A then B; selected inner mean is 3/2 and outer mean is 7.
An exact selection effect from a stipulated joint law
Two fixed candidates both have true risk 5. Their scores are 5+Z and 5−Z, where Z=2 or −2 with equal probability. Find each score’s expectation, the expected selected minimum and its bias relative to the selected candidate’s true risk.
- Since E[Z]=0, each candidate score is individually unbiased for 5.
- If Z=2, scores are (7,3); if Z=−2, they are (3,7). In either case the smaller score is 3.
- The chosen candidate still has risk 5, so the selected score has bias 3−5=−2 relative to that selected risk.
- The scores in this construction are negatively related. The example shows a mechanism of selection optimism without assuming independence or asserting that all actual assessment scores follow this law.
Each candidate score averages 5, but the selected score is always 3 and has bias −2.
Trace the label that entered a held-out feature
Training rows have fictional IDs A,B and labels 0,1; held-out rows have new IDs C,D and labels 0,1. A leaked encoder assigns each unique ID the mean of its labels computed on the combined dataset, and a rule predicts that value. Compare its apparent held-out MSE with a training-only encoder using the training mean for unseen IDs. Suppose future labels are independent fair Bernoulli values with no ID signal.
- The combined-data encoder maps C to its own held-out label 0 and D to its own held-out label 1. The apparent held-out MSE is therefore 0.
- The encoder has used the very outcomes it purports to predict. The calculation does not evaluate a rule independent of those held-out labels.
- Using only training labels gives mean 1/2. C and D are unseen, so the stated fallback predicts 1/2 for both and their observed MSE is [(0−1/2)²+(1−1/2)²]/2=1/4.
- Under the stipulated no-signal Bernoulli population, the fixed 1/2 prediction also has fresh risk 1/4. The leaked zero is information reuse, not evidence of a predictive relationship with an ID.
Leaked apparent test MSE is 0; the stated training-only fallback has observed and fresh MSE 1/4.
Compute a finite-sample radius with its actual premises
A predictor frozen independently of an iid test set has n=200 losses in [0,1] and observed mean 1/5. At δ=1/20, give its Hoeffding interval. Also compute a simultaneous radius for 20 candidate functions all fixed independently of that same test set.
- For one function, solve 2exp(−400ε²)=1/20. The radius is sqrt(log(40)/400), approximately 0.0960322791. Intersecting with [0,1] gives approximately [0.1039677209,0.2960322791].
- For M=20, use 40exp(−400ε²)=1/20. The common radius is sqrt(log(800)/400), approximately 0.1292730804.
- The second radius covers all 20 fixed risks simultaneously with probability at least 19/20 under repeated iid test sampling. A test-selected member of that original family is covered on the same simultaneous event.
- Candidates may share training data and predictions; they need not be mutually independent. All must be fixed independently of test outcomes. Arbitrary unbounded MSE and models invented after viewing test labels are outside these premises.
One-function radius sqrt(log(40)/400); 20-function simultaneous radius sqrt(log(800)/400), under independent bounded test sampling.
Separate an unbiased weighted mean from a normalized ratio
A fixed predictor has deterministic losses 1 and 9 at X=0 and X=1. Source probabilities are (3/4,1/4), target probabilities (1/2,1/2), and the conditional response law is unchanged. Compute both risks and the known weights. For an assessment record X=(0,0,1), compute the ordinary weighted mean and the self-normalized ratio. Explain the n=1 ratio bias.
- The source risk is (3/4)·1+(1/4)·9=3; target risk is (1/2)·1+(1/2)·9=5. Exact weights are w(0)=2/3 and w(1)=2, giving E_P[wL]=5.
- For the specified deterministic losses, the observed weighted numerator is 2/3+2/3+18=58/3. Dividing by sample size 3 gives 58/9. A particular unbiased estimator realization can exceed the target risk.
- The observed sum of weights is 2/3+2/3+2=10/3, so the self-normalized ratio is (58/3)/(10/3)=29/5. It is a different estimator.
- At n=1 each weight is positive and cancels in the ratio, leaving the ordinary source loss. Its expectation is 3 rather than target risk 5, an exact finite-sample bias of −2. If source probability at X=1 were zero while target probability remained positive, this weighting identity would lack the required support.
Weights (2/3,2); source/target risks 3 and 5. Observed weighted mean 58/9, normalized ratio 29/5; the one-row ratio averages 3.
Use the finite calibration rank, including its boundary
An independently trained predictor has nine absolute calibration scores (1,2,2,3,4,5,6,7,9) u. At α=1/5 and a new point prediction of 10 u, give the split-conformal interval. What does this same rank construction give at α=1/20?
- At α=1/5, k=ceil(10·4/5)=8. The eighth calibration score is 7 u, so the closed interval is [10−7,10+7]=[3,17] u.
- Under conditional training/calibration-test exchangeability, the rank argument gives marginal new-response coverage at least 4/5, averaging over calibration and the new observation. It is not a conditional-on-x or observed-calibration probability statement.
- At α=1/20, k=ceil(10·19/20)=10=m+1. The explicitly completed rule uses q=+∞ and returns the whole response line.
- Replacing that infinity by the largest calibration score would be a different rule without this displayed rank guarantee at the requested level. The boundary concerns this construction and these assumptions, not an impossibility claim about every predictive method.
At α=1/5 the interval is [3,17] u; at α=1/20 this completed rank rule returns the whole real line.
Try it yourself
At a fixed feature value, independent future-response variance is 9 kg², ensemble prediction bias is −2 kg and predictor variance across training outcomes is 3 kg². Find ensemble squared prediction risk. A particular fit instead differs from the true conditional mean by −4 kg; find its conditional fresh risk.
Show the answer and reasoning
Ensemble risk 16 kg²; conditional risk of the stated realized fit 25 kg².
With finite second moments, the ensemble result is 9+(−2)²+3=16. Fixing the realized prediction instead gives 9+(−4)²=25. The deviations are from the true conditional mean, not observed residuals. Training variance is not added again after fixing the fit.
Including its random seed, a training procedure produces a fitted rule with conditional risk 1 with probability 3/4 and risk 9 with probability 1/4. Find its algorithm-average risk. What risk applies to a realized rule from the second outcome?
Show the answer and reasoning
Algorithm-average risk 3; the stated second realized rule has risk 9.
Averaging over the stipulated training-and-seed law gives (3/4)·1+(1/4)·9=3. The realized second outcome has conditional risk 9. The average is not a confidence interval for that outcome, and the two stipulated values do not determine how an actual assessment score is distributed.
A fixed OLS design has n=10 and six columns but actual rank 4. Assume a correct mean and known homogeneous error variance 5 u². Find expected training MSE, fresh same-X response MSE and optimism. What is the fresh-response corrected score if observed SSE is 20 u²?
Show the answer and reasoning
Expected training MSE 3 u², fresh MSE 7 u² and optimism 4 u². The observed corrected score is 6 u².
Use the projection rank: 5(1−4/10)=3 and 5(1+4/10)=7. The covariance correction is 2·5·4/10=4, so the observed score is 20/10+4=6. Redundant columns do not add fitted directions. This fixed-space result is neither a random-X guarantee nor a post-selection parameter-count rule.
Let S=diag(1,1/3) be fixed, with n=2, μ=0 and covariance 2I u². Compute tr(S), tr(SᵀS), expected training and fresh same-X MSE. Is SSE/(n−tr(S)) unbiased for the true variance 2 u²?
Show the answer and reasoning
tr(S)=4/3, tr(SᵀS)=10/9, expected training MSE 4/9 u² and fresh MSE 28/9 u². The proposed variance estimate has expectation 4/3 u², so it is not unbiased here.
The residual-noise trace is 0²+(2/3)²=4/9. Training MSE is (2/2)(4/9)=4/9; fresh MSE is 2+(2/2)(10/9)=28/9. Expected SSE is 8/9, while n−tr(S)=2/3. Their ratio is 4/3, not 2. This disproves blindly substituting a covariance trace into an OLS residual-df formula.
Two held-out folds contain 2 and 5 observations and have mean losses 3 and 7 u². Find a row-uniform score and a fold-uniform score. State what further target issue arises from unequal fold sizes.
Show the answer and reasoning
Row-uniform score 41/7 u²; fold-uniform score 5 u². The fitted rules use different training sizes.
The pooled numerator is 2·3+5·7=41 over seven rows. Giving the two fold means equal weight gives (3+7)/2=5. The intended averaging unit decides which score is relevant. Because each fit withholds a different number of observations, a claim about one common training-size risk also requires justification.
For an intercept-only record y=(−1,1,2,3,5), find the fitted mean, SSE, PRESS and LOO mean loss. Separately, for iid common-mean observations of variance 2 u², compare expected fresh risk for means trained on 4 and 5 observations.
Show the answer and reasoning
Mean 2, SSE 20, PRESS 125/4 and LOO mean loss 25/4. The two population risks are 5/2 and 12/5 u², differing by 1/10 u².
Residuals are (−3,−1,0,1,3), and intercept leverage is 1/5. Using the retained deletion identity multiplies each residual by 5/4, so PRESS=(25/16)·20=125/4. Separately, fresh mean-prediction risk is 2(1+1/m). Thus training sizes 4 and 5 give 5/2 and 12/5. The population variance is stipulated, not inferred exactly from this record.
Three equal outer folds have inner scores (A,B)=(2,5),(4,1),(3,6). After inner selection and refitting within each outer training portion, their untouched outer losses are 8,3,7. Give the selected configurations and the two relevant averages.
Show the answer and reasoning
Configurations A,B,A; outer mean 6 and selected-inner mean 2.
The inner minima are 2,1,3, averaging 2. Untouched outer losses sum to 18, averaging 6. The outer protocol evaluates the selection procedure at its outer training size, provided all learned operations stayed inside the corresponding training boundaries. It is not an exact conditional-risk evaluation of the final all-data fit.
Two candidates each have true risk 4. Their individually unbiased scores are 4+U and 4−U, where U=1 or −1 with equal probability. Find the expected selected minimum and its bias relative to the selected true risk.
Show the answer and reasoning
Selected mean 3, selected true risk 4, bias −1.
The score pairs are (5,3) and (3,5), so the minimum is always 3. Each original score still averages 4. This is a stipulated joint law illustrating selection; it asserts neither mutual independence nor a universal numerical bias for cross-validation.
Forty labeled rows are assessed using five equal folds. Before splitting, a filter ranks 20 genes by correlation with all 40 labels and retains three. The analyst then cross-validates a classifier on those features. Identify the leak and the appropriate fitting boundary, including any tuning of the filtering rule.
Show the answer and reasoning
Each fold’s eight held-out labels helped choose its features. Relearn the filter on the 32 training rows; if its rule is tuned, repeat that learning within each relevant inner training split.
Supervised feature selection is part of the learner even though it occurred before classifier fitting. A held-out row must not help choose the rule used to predict it. The protocol is contaminated without needing a claim that its numerical bias has one direction or a fixed size on every dataset. These are hypothetical features, not private genomic observations.
Held-out group A contributes one row of loss 9. Group B contributes three rows, each of loss 1. Find the row-uniform average and the equally weighted group-average loss. Which matches a uniformly selected group’s average loss?
Show the answer and reasoning
Row-uniform loss 3; equal-group loss 5. The latter matches the stipulated uniformly selected group target.
Pooling rows gives (9+1+1+1)/4=3. Averaging group means gives (9+1)/2=5. For assessment of unseen groups, every held-out group must also be separated from training. That separation does not choose the desired weighting and does not make rows within a group independent.
At prediction day 10, a rule forecasts the day 12 outcome using information available by day 10. A training row with origin r uses its day r+2 outcome as its label. What is the latest eligible training origin? Can a day 11 feature be used, and does a two-origin gap prove iid errors?
Show the answer and reasoning
Latest origin 8; the day 11 feature is unavailable. The gap does not prove iid errors.
The training label must already exist: r+2≤10 implies r≤8. A day 11 measurement is outside the stated cutoff. This timing argument respects the specified horizon, while independence, stationarity and adequate treatment of other dependence remain separate claims. A different deployment information set would require a different eligibility calculation.
A frozen predictor is tested on 500 iid losses in [0,1], with empirical mean 1/10. For δ=1/10, give a two-sided Hoeffding interval. What minimum integer n makes the radius at most 1/20 at the same δ?
Show the answer and reasoning
Radius sqrt(log(20)/1000)≈0.0547332831, interval approximately [0.0452667169,0.1547332831]. The minimum integer n is 600.
The radius solves 2exp(−2nε²)=δ. At ε=1/20, n≥200log(20)≈599.14645, so 600 is the first integer satisfying the bound. Independence, loss boundedness and a predictor fixed independently of the test are essential. This is not a general unbounded-MSE interval or a posterior statement.
Eight functions are fixed by training independently of a common set of 400 iid test points. Their losses lie in [0,1]. At δ=1/10, find a common risk radius. Can the empirical best member be selected afterward while retaining that simultaneous bound?
Show the answer and reasoning
Radius sqrt(log(160)/800)≈0.0796490255. Selection within this original fixed family retains the simultaneous event.
The union bound gives 8·2exp(−800ε²)≤1/10. On the event that all eight risk errors are bounded, the test-selected index is also bounded. Candidate functions need not be mutually independent. Creating a new function from test labels or counting only a family selected afterward is outside this premise.
A fixed predictor has deterministic losses (2,6) at two feature values. Source probabilities are (1/2,1/2), target probabilities (3/4,1/4), with unchanged conditional response law. Give the known weights and both risks. For a one-row source sample, what is the expected self-normalized weighted loss?
Show the answer and reasoning
Weights (3/2,1/2), source risk 4 and target risk 3. The one-row self-normalized estimate averages 4, giving bias 1 for target risk.
Known weighting gives (1/2)(3/2)·2+(1/2)(1/2)·6=3. With one row the positive weight cancels, leaving its source loss of expectation 4. Support is covered in this example. Estimated weights, conditional-law changes and larger-sample ratio properties need their own justification.
Source data only observe X=0, where loss is 1. The target assigns probabilities 3/4 and 1/4 to X=0 and X=1. Two possible worlds have loss at X=1 equal to 0 or 4. Compute their target risks. Can weighting the observed source data distinguish them?
Show the answer and reasoning
Target risks 3/4 and 7/4; source weighting alone cannot distinguish the worlds.
The source observations are identical, but target risk is (3/4)·1+(1/4)L(1). Positive target mass lies outside source support, so Q_X is not absolutely continuous with respect to P_X. An additional extrapolation assumption might address the unseen region; a density-ratio identity on observed support does not supply it.
A separately trained predictor gives 5 u at a new feature value. Four absolute calibration scores are (1,2,2,2) u. At α=2/5, give k, the threshold and the closed interval, including how equality is treated. What is the completed threshold at α=1/10?
Show the answer and reasoning
At α=2/5, k=3, threshold 2 u and interval [3,7] u; equality is included. At α=1/10, k=5=m+1 and the threshold is +∞.
The ranks are ceil(5·3/5)=3 and ceil(5·9/10)=5. Inclusive ties can make coverage conservative. Under calibration-test exchangeability conditional on independent training, the claim is marginal coverage, not coverage at every x or conditional on this observed calibration set. The infinity rule is the stated completion of this rank construction.
Future responses are independent fair ±1. Frozen predictor A always gives 0 and is tested on responses (1,1), with losses (1,1). After viewing them, predictor B is refit as their sample mean. Find R_A and the conditional fresh risk of this realized B. Does A’s assessment automatically qualify B?
Show the answer and reasoning
R_A=1; realized B predicts 1 and has conditional fresh risk 2. A’s assessment does not automatically transfer.
For A, E[Y²]=1. For the stated realization B=1, E[(Y−1)²]=2. The refit used the test responses and changed the predictor. The example does not claim every refit worsens risk: over the possible two-response records, the realized mean can be −1,0 or 1 and its corresponding conditional risk is 2,1 or 2.
What to carry forward
- A prediction claim specifies its future population and unit, loss, available information and training procedure.
- Conditional risk of one fitted rule differs from algorithm-average risk and from risk at a different training size.
- Squared-error bias–variance accounting averages over explicitly stated sources of randomness; an observed residual does not identify prediction bias.
- Training optimism has an exact covariance identity for independent same-design replicates; fixed trace corrections do not automatically survive response-dependent selection.
- Actual projection rank, covariance adaptation and residual-noise traces are distinct quantities for general smoothers.
- Cross-validation must learn every pipeline step inside its training boundary, weight the intended units and state its training-size target.
- Nested assessment evaluates the selection procedure; repeated holdout use and correlated folds require their own uncertainty argument.
- Untouched independent tests and fixed-family simultaneous bounds support precise claims under their boundedness and information conditions.
- Known-ratio weighting requires support and conditional-law stability; self-normalization and estimated weights change the finite-sample argument.
- Predictive coverage, scientific transport and causal identification are separate conclusions, each requiring its own evidence.
References
Sources for the concepts and teaching approaches in this article.
- Econometrics: Regression and Projection; Least-Squares InferenceBruce E. Hansen; January 10, 2010 author manuscriptAuthor university textbook · PDF
- No Unbiased Estimator of the Variance of K-Fold Cross-ValidationYoshua Bengio and Yves GrandvaletPrimary research paper · PDF
- On Over-fitting in Model Selection and Subsequent Selection Bias in Performance EvaluationGavin C. Cawley and Nicola L. C. TalbotPrimary research paper · PDF
- Cross-validation: what does it estimate and how well does it do it?Stephen Bates, Trevor Hastie and Robert TibshiraniAuthor research preprint · PDF
- Covariate Shift Adaptation by Importance Weighted Cross ValidationMasashi Sugiyama, Matthias Krauledat and Klaus-Robert MüllerPrimary research paper · PDF
- Distribution-Free Predictive Inference for RegressionJing Lei, Max G’Sell, Alessandro Rinaldo, Ryan J. Tibshirani and Larry WassermanAuthor research paper · PDF
- Lecture Notes for STAT240 (Robust and Nonparametric Statistics)Jacob Steinhardt; April 1, 2021 notesAuthor university course · PDF
- Bias in error estimation when using cross-validation for model selectionSudhir Varma and Richard SimonPrimary research paper