Skip to content

The cheat sheet

Use this as a reference after working through an example. For a question that feels unreadable, start with a notation walkthrough.

symbolmeaningexample
XX, xxrandom input; a particular inputa campaign; its measured spend
XjX_j, xjx_jfeature jTV spend within one input
(xi,yi)(x_i,y_i)training row ithat campaign’s spend and sales
p, Nnumber of features; number of examples3 features, 200 campaigns
f(x)f(x)true conditional meanE[YX=x]\mathbb E[Y\mid X=x]
f^D(x)\hat f_D(x)prediction from a model fitted on Dchanges if you train on different data
ε\varepsilonoutput minus conditional meanYf(X)Y-f(X)
σ2(x)\sigma^2(x)conditional output varianceconstant σ2\sigma^2 in our simulations
θ\theta, θ^\hat\thetacandidate parameters; fitted parametersintercept and slopes
βx\beta^\top xdot productj=1pβjxj\sum_{j=1}^{p}\beta_jx_j
argminθ\operatorname{argmin}_\thetaparameter choice with the lowest scorereturns parameters, not the minimum score
expressionhold fixedaverage over
E[YX=x]\mathbb E[Y\mid X=x]input xpossible outputs at x
ED[f^D(x)]\mathbb E_D[\hat f_D(x)]input and training methodtraining datasets D
E[(Yg(X))2]\mathbb E[(Y-g(X))^2]prediction rule gnew input–output pairs
1Mi(yif^(xi))2\frac1M\sum_i(y_i-\hat f(x_i))^2fitted model and held-out datasetthe finite list of observed errors

Define f(x)=E[YX=x]f(x)=\mathbb E[Y\mid X=x] and ε=Yf(X)\varepsilon=Y-f(X). Then E[εX=x]=0\mathbb E[\varepsilon\mid X=x]=0 by definition (when the conditional mean exists).

Constant conditional variance, Var(εX=x)=σ2\operatorname{Var}(\varepsilon\mid X=x)=\sigma^2, is an extra assumption. Independent noise is stronger: fixing X leaves its entire distribution unchanged. The examples use independent, constant-variance noise; the conditional-mean result does not require those simplifications.

For one prediction c, assuming finite second moments:

E[(Yc)2]=Var(Y)+(E[Y]c)2.\mathbb E[(Y-c)^2]=\operatorname{Var}(Y)+(\mathbb E[Y]-c)^2.

The best c is the mean. Absolute loss instead selects a median.

For a fixed predictor h at a fixed input x:

E[(Yh(x))2X=x]=(f(x)h(x))2+σ2(x).\mathbb E[(Y-h(x))^2\mid X=x]=(f(x)-h(x))^2+\sigma^2(x).

For a training method repeated across datasets, scored on an independent fresh output at x:

R(x)=Bias(x)2+VarD(f^D(x))+σ2(x),Bias(x)=ED[f^D(x)]f(x).\begin{aligned} R(x)&=\operatorname{Bias}(x)^2+\operatorname{Var}_D(\hat f_D(x))+\sigma^2(x),\\ \operatorname{Bias}(x)&=\mathbb E_D[\hat f_D(x)]-f(x). \end{aligned}

For overall expected error, average R(x)R(x) over inputs too. A finite test-set MSE is an estimate of one fitted model’s performance; it is not exactly this population decomposition.

  1. Fit parameter values on training data.
  2. Use validation data or cross-validation to choose degree, regularization, or model family.
  3. Assess the frozen choice on separate test data.

Minimum unpenalized training error cannot increase when the candidate families are nested and the same objective is minimized on the same data. A U-shaped expected-error curve is a classical example, not a universal law.

More data often stabilizes fitted predictions. It does not let a straight line represent arbitrary curvature. The bias of an estimator can also depend on sample size.

For uniform points in a unit-radius ball and a radius-r ball at its center, with 0≤r≤1:

Pr(inside)=rp,E[count]=Nrp.\Pr(\text{inside})=r^p,\qquad \mathbb E[\text{count}]=Nr^p.

To get k expected neighbors, r=(k/N)1/pr=(k/N)^{1/p}. For N=1,000 and k=10, r is about 0.63 in ten dimensions. That is 63% of the radius but 1% of the volume. Boundary effects, nonuniform sampling, and lower-dimensional structure change this calculation.

For a unit ball inside a cube of side 2, the fraction of cube volume is

πp/22pΓ(p/2+1).\frac{\pi^{p/2}}{2^p\Gamma(p/2+1)}.

Output variance versus prediction variance

Output variance describes the possible Y values at one x. Prediction variance describes the predictions from repeatedly trained models at that same x. More training examples can reduce the second while the first stays unchanged.

Can a measured error be below the noise floor?

Yes. The floor bounds expected squared error using the specified inputs. A finite sample can have unusually small noise; training also adapts the model to its particular sample. A low training score alone does not diagnose overfitting.

Is irreducible error permanently irreducible?

It is relative to the measured inputs. A useful additional feature can explain variation that was previously noise. That may reduce conditional output variance, while also making estimation more demanding with a finite sample.

Practice without topic labels →

Definition

Read the full glossary entry →