Part IV Theory 1 Generalization

Learning Theory

Why does a model that fits old data work on new data? Learning theory answers that question. It also tells you when the answer is no.

Every Applied Science loop has a theory moment. Someone asks why your model overfit, or why a huge network did not. They ask why offline gains vanished online. All three are learning theory questions. This page covers the core ideas with real math. Each topic ends with what it means for shipped models and the questions you will hear.

You do not need to prove theorems in the interview. You do need to state them right, know their assumptions, and say where they break. That is the senior bar.

Contents

  1. The learning problem: risk and ERM
  2. Bias-variance decomposition
  3. Generalization gap and data splits
  4. PAC learning for finite classes
  5. VC dimension
  6. Rademacher complexity
  7. Regularization and priors
  8. No free lunch and inductive bias
  9. Double descent and big nets
  10. Distribution shift
  11. Loss functions and their properties
The one idea behind the whole page. Test error equals training error plus a gap. Theory bounds the gap. The bound grows with how flexible your model class is. It shrinks with how much data you have. Every topic below is a version of that trade.

Part A — The Core Setup

1. The learning problem: risk, empirical risk, ERM

Plain definition. We want a function that makes small errors on data we have not seen. We cannot measure that error directly. So we measure error on data we have and hope the two match.

The formal setup

Two quantities drive everything. The true risk is what we care about. The empirical risk is what we can compute.

True risk:        R(h)  = E(x,y)~D [ ℓ(h(x), y) ]

Empirical risk:   R̂S(h) = (1/m) ∑i=1..m ℓ(h(xi), yi)

ERM:              ĥ = argminh ∈ H R̂S(h)

For any fixed h, the empirical risk is an unbiased estimate of the true risk. So ES[R̂S(h)] = R(h). But this breaks for the ERM winner. We picked ĥ because it looked good on S. So R̂S(ĥ) is biased low. That bias is the heart of overfitting.

Three sources of error

Let h* be the best possible predictor over all functions. This is the Bayes predictor. Let hH be the best predictor inside H. Then the excess risk of the ERM output splits in two.

R(ĥ) − R(h*) = [ R(hH) − R(h*) ]  +  [ R(ĥ) − R(hH) ]
                approximation error     estimation error

The key bound for ERM

One short argument links the gap to uniform convergence. Suppose every h in H has |R(h) − R̂S(h)| ≤ ε. Then ERM is close to the best in class.

R(ĥ) ≤ R̂S(ĥ) + ε        (uniform convergence)
     ≤ R̂S(hH) + ε      (ĥ minimizes empirical risk)
     ≤ R(hH) + 2ε       (uniform convergence again)

So all of classical theory reduces to one job. Bound suph |R(h) − R̂S(h)|. PAC, VC and Rademacher are three ways to do it.

Intuition

Think of a class of 1,000 students who all guess on a 10 question quiz. Someone will score 9 out of 10 by luck. If you hire the top scorer, you hired luck. The more students you test, the higher the luckiest score. A bigger hypothesis class is a bigger class of guessers.

Why it matters in practice

Interview check

2. Bias-variance decomposition

Plain definition. Test error has three parts. Bias is how wrong the model is on average. Variance is how much it changes when the training data changes. Noise is the part no model can remove.

Setup

Let y = f(x) + ε, where E[ε] = 0 and Var(ε) = σ2. Train a model on a random dataset D. Call the result ĥD. Define the average model over all training sets as h̄(x) = ED[ĥD(x)]. Fix a test point x. The noise ε at x is independent of D.

Derivation for squared loss

Write the error as a sum of two pieces. Then expand.

ED,ε[ (y − ĥD(x))2 ]
  = E[ (f(x) + ε − ĥD(x))2 ]
  = E[ε2] + 2 E[ε] E[f(x) − ĥD(x)] + E[ (f(x) − ĥD(x))2 ]
  = σ2 + 0 + ED[ (f(x) − ĥD(x))2 ]

Now add and subtract h̄(x) inside the last term:

ED[ (f − h̄ + h̄ − ĥD)2 ]
  = (f − h̄)2 + 2 (f − h̄) ED[h̄ − ĥD] + ED[ (ĥD − h̄)2 ]
  = (f − h̄)2 + 0 + VarD(ĥD(x))

Result:
E[(y − ĥD(x))2] = σ2  +  (f(x) − h̄(x))2  +  VarD(ĥD(x))
                     noise        bias2             variance

Both cross terms die for the same reason. One factor is a constant and the other has mean zero. The first uses E[ε] = 0 and independence. The second uses ED[ĥD] = h̄ by definition. Average over x to get the full test error.

Model complexity → Expected error σ² sweet spot bias² variance total = bias² + variance + σ² underfit overfit
The classical U curve. Bias falls and variance rises as the class grows. Section 9 shows where this picture breaks.

A runnable check

This demo fits polynomials of several degrees to 500 fresh datasets. It then measures bias and variance directly.

import numpy as np

rng = np.random.default_rng(0)
f = lambda x: np.sin(2 * np.pi * x)          # true function
sigma, n, trials = 0.3, 30, 500
x_test = np.linspace(0.05, 0.95, 200)

for degree in [1, 3, 5, 7]:
    preds = np.empty((trials, x_test.size))
    for t in range(trials):
        x = rng.uniform(0, 1, n)
        y = f(x) + sigma * rng.standard_normal(n)
        coef = np.polyfit(x, y, degree)
        preds[t] = np.polyval(coef, x_test)
    mean_pred = preds.mean(axis=0)
    bias2 = np.mean((mean_pred - f(x_test)) ** 2)
    var = np.mean(preds.var(axis=0))
    print(f"degree {degree:2d}: bias^2={bias2:.3f}  var={var:.3f}  "
          f"expected test MSE={bias2 + var + sigma**2:.3f}")

# degree  1: bias^2=0.152  var=0.021  expected test MSE=0.263
# degree  3: bias^2=0.003  var=0.013  expected test MSE=0.106
# degree  5: bias^2=0.000  var=0.026  expected test MSE=0.117
# degree  7: bias^2=0.001  var=0.380  expected test MSE=0.471

Degree 1 is all bias. Degree 7 is all variance. Degree 3 wins. Note the noise floor of 0.09 sits under every row.

Intuition

Picture a dartboard. Bias is how far the center of your throws sits from the bull's-eye. Variance is how spread out the throws are. A rigid model throws tight but off center. A flexible model centers well but scatters.

The clean split only holds for squared loss. For 0-1 loss, bias and variance interact. High variance can even help when the bias is wrong. Domingos (2000) gives a unified version. Do not claim the additive formula for classification error.

Why it matters in practice

Interview check

3. Generalization gap and train, validation, test logic

Plain definition. The generalization gap is test error minus training error. Data splits exist to measure it honestly. Each split must be untouched by the choice it judges.

The math of a held-out estimate

The test set works because the model is fixed before we look. Then the test losses are i.i.d. with mean R(h). For a loss in [0, 1], Hoeffding's inequality bounds the error of the estimate.

P( |R̂test(h) − R(h)| > ε ) ≤ 2 exp(−2 ntest ε2)

With probability 1 − δ:  |R̂test(h) − R(h)| ≤ √( ln(2/δ) / (2 ntest) )

With 10,000 test points and δ = 0.05, the error is at most 0.0136. That holds for one model. Pick the best of k models on the same set and the bound needs ln(2k/δ). That is the union bound from Section 4.

Why three splits

Cross-validation

K-fold CV trains K models, each on (K−1)/K of the data. It averages the held-out errors. It uses data well but has two subtle points.

When i.i.d. splits lie

Random splits assume test data comes from the same D. Production data rarely does. Pick a split that mirrors deployment.

The rule. A split is honest only if nothing about the split influenced the model. Every peek turns test data into training data, a little at a time.

Why it matters in practice

Interview check

Part B — Bounding the Gap

4. PAC learning and sample complexity for finite classes

Plain definition. PAC means Probably Approximately Correct. A class is PAC learnable if enough data gives, with high probability, a model with low error. Sample complexity is how much data is enough.

The definition

A class H is PAC learnable if a learner exists with this property. For every ε, δ in (0, 1) and every distribution D, given m ≥ mH(ε, δ) samples, it outputs ĥ with:

PS~Dm( R(ĥ) ≤ minh∈H R(h) + ε ) ≥ 1 − δ

Two tools

Hoeffding's inequality. For i.i.d. Zi in [0, 1] with mean μ:

P( |(1/m) ∑ Zi − μ| > ε ) ≤ 2 exp(−2 m ε2)

Union bound. P(A1 or … or Ak) ≤ ∑ P(Aj). It needs no independence.

Derivation: agnostic finite class

Let the loss lie in [0, 1]. Call h "bad" if its empirical risk is more than ε from its true risk.

P( ∃ h ∈ H : |R̂S(h) − R(h)| > ε )
   ≤ ∑h∈H P( |R̂S(h) − R(h)| > ε )     (union bound)
   ≤ |H| · 2 exp(−2 m ε2)                    (Hoeffding)

Set the right side to δ and solve:

  m ≥ ( ln|H| + ln(2/δ) ) / (2 ε2)

Equivalently, with probability ≥ 1 − δ, for ALL h ∈ H at once:

  R(h) ≤ R̂S(h) + √( (ln|H| + ln(2/δ)) / (2m) )

This gives uniform convergence at level ε. By the argument in Section 1, ERM is then within 2ε of the best in class.

Derivation: realizable finite class

Now assume some h in H has zero true error. ERM returns a consistent h, one with zero training error. We bound the chance that a bad h with R(h) > ε stays consistent.

P( one bad h fits all m points ) ≤ (1 − ε)m ≤ e−εm

P( any bad h is consistent ) ≤ |H| e−εm ≤ δ

  m ≥ ( ln|H| + ln(1/δ) ) / ε

Realizable needs 1/ε samples. Agnostic needs 1/ε2. The gap comes from variance. With zero error the estimate has no noise near zero. With nonzero error it does.

Read the formula out loud. Data grows with the log of the class size. Doubling |H| costs only ln 2 more in the numerator. Halving ε costs 4 times the data in the agnostic case. Confidence is almost free since it enters as ln(1/δ).

A worked number

A model has d = 100 parameters stored as 32-bit floats. Then |H| ≤ 23200, so ln|H| ≈ 2,218. For ε = 0.05 and δ = 0.01 in the agnostic case:

m ≥ (2218 + ln 200) / (2 · 0.0025) = (2218 + 5.3) / 0.005 ≈ 444,700

This "discretization trick" shows a key point. Even a continuous class has effective size near 2bits × params. So sample complexity scales with parameter count times precision. That is crude, and VC dimension makes it sharper.

Why it matters in practice

Interview check

5. VC dimension and what it says

Plain definition. VC dimension measures how many points a class can label in every possible way. It replaces "number of hypotheses" with "number of behaviors". So it works for infinite classes like all lines in the plane.

Definitions

3 points: every labeling is separable Two of the 8 labelings shown. Lines handle all 8. (Points must not be collinear.) 4 points: XOR labeling fails No line puts both blues on one side. So lines in R² have VC dimension 3.
To prove VC dimension d, find one set of d points that is shattered. Then show no set of d+1 points is.

Common values

Sauer's lemma and the VC bound

The magic step is Sauer's lemma. Once m passes d, the growth function turns from exponential to polynomial.

ΠH(m) ≤ ∑i=0..d C(m, i) ≤ (e m / d)d       for m ≥ d

VC generalization bound (with probability ≥ 1 − δ, for all h ∈ H):

R(h) ≤ R̂S(h) + O( √( ( d log(m/d) + log(1/δ) ) / m ) )

Sample complexity:
  agnostic:    m = Θ( (d + log(1/δ)) / ε2 )
  realizable:  m = Θ( (d + log(1/δ)) / ε )    (ERM pays an extra log(1/ε))

The proof swaps the infinite class for its finite set of behaviors on a double sample. That is the symmetrization trick. Then it applies the finite class bound with |H| replaced by ΠH(2m). So ln|H| becomes about d log m.

The fundamental theorem

For binary classification with 0-1 loss, these are equivalent. H has finite VC dimension. H has uniform convergence. ERM is a PAC learner. H is PAC learnable. So finite VC dimension is exactly the condition for learnability in this setting.

What it does and does not say

Why it matters in practice

Interview check

6. Rademacher complexity

Plain definition. Rademacher complexity asks one question. How well can the class fit pure random noise on your actual data? A class that fits noise well can fool itself, so its gap is large.

Definition

Draw σ1, …, σm as independent random signs, each ±1 with probability 1/2. These are Rademacher variables. For a class F of real functions and a fixed sample S:

Empirical:  R̂S(F) = Eσ[ supf∈F (1/m) ∑i=1..m σi f(xi) ]

Expected:   ℜm(F) = ES[ R̂S(F) ]

The sum is the correlation between f and random labels. The sup picks the f that matches the noise best. If the class can match any sign pattern, the value is near 1. If it can only fit smooth trends, it is near 0.

The bound

Let the loss class be G = {(x, y) → ℓ(h(x), y) : h ∈ H} with values in [0, 1]. Then with probability at least 1 − δ, for all h in H:

R(h) ≤ R̂S(h) + 2 ℜm(G) + √( ln(1/δ) / (2m) )

Data-dependent version:
R(h) ≤ R̂S(h) + 2 R̂S(G) + 3 √( ln(2/δ) / (2m) )

The proof has two steps. McDiarmid's inequality shows the worst-case gap concentrates near its mean. Then symmetrization bounds that mean by twice the Rademacher complexity.

Useful facts

Intuition

VC dimension asks if the class can fit every labeling of some worst set of points. Rademacher asks how well it fits random labelings of your points, on average. It is data dependent and measures fit, not just yes or no. That makes it tighter and lets it see norms and margins.

The random label experiment. Zhang et al. (2017) trained standard CNNs on CIFAR-10 with shuffled labels. The nets hit zero training error. So their empirical Rademacher complexity is near its max. Any bound built from the class alone must be vacuous. Whatever explains their generalization involves the data, the algorithm, or both.

Why it matters in practice

Interview check

Part C — Controlling Capacity

7. Regularization as capacity control and as a Bayesian prior

Plain definition. Regularization adds a penalty that favors simpler models. One view says it shrinks the class, which shrinks the gap. The other view says it encodes a prior belief about the weights.

The capacity view

Regularized ERM solves a penalized problem. By Lagrange duality, it matches a constrained problem for some radius B.

minw  R̂S(w) + λ Ω(w)      ⇔      minw R̂S(w)  subject to  Ω(w) ≤ B

For a linear model with ||w||2 ≤ B, Section 6 gave a gap of order BX/√m. So λ directly sets the capacity. Larger λ means smaller B, more bias and less variance. This is structural risk minimization (Vapnik). You pick the class size that minimizes a bound on test error.

The Bayesian view

Assume Gaussian noise y = w·x + ε with ε ~ N(0, σ2). Put a prior on the weights. Then the MAP estimate is a penalized fit.

Prior:      w ~ N(0, τ2 I)
Posterior:  p(w | S) ∝ exp( −||y − Xw||2 / (2σ2) ) · exp( −||w||2 / (2τ2) )

−log posterior = ||y − Xw||2 / (2σ2) + ||w||2 / (2τ2) + const

Multiply by 2σ2:   ||y − Xw||2 + (σ2/τ2) ||w||2      ⇒   ridge with λ = σ2/τ2

Laplace prior p(wj) ∝ exp(−|wj|/b)        ⇒   lasso with λ = 2σ2/b

The ratio σ2/τ2 reads well. Noisy data or a tight prior means strong regularization. MAP is still a point estimate. Full Bayes would average over the posterior and give uncertainty too.

What ridge does to each direction

Take the SVD X = U D VT with singular values dj. Ridge has a closed form and a clean reading.

ŵridge = (XTX + λI)−1 XT y

X ŵridge = ∑j uj · [ dj2 / (dj2 + λ) ] · ujT y

Effective degrees of freedom:   df(λ) = ∑j dj2 / (dj2 + λ)

Lasso versus ridge

Regularizers that do not look like penalties

Why it matters in practice

Interview check

8. No free lunch and inductive bias

Plain definition. No learner is best on every problem. Averaged over all possible targets, every learner does equally well on unseen points. A learner only wins by making assumptions that fit the real world. Those assumptions are its inductive bias.

Two forms of the theorem

Wolpert (1996). Average over all target functions on a finite domain, uniformly. Then every learner has the same expected error on points outside the training set. That error is chance.

The PAC form (Shalev-Shwartz and Ben-David). Let A be any learner for binary labels with 0-1 loss. Let m < |X|/2. Then a distribution D exists with two properties.

So the class of all functions is not PAC learnable on an infinite domain. You must restrict H. That restriction is a prior choice made before you see data.

Why it is true

Training data says nothing about unseen points unless you assume a link. If every labeling of the unseen points is equally likely, any guess is a coin flip. Learning needs a reason to believe nearby points share labels, or that the world is smooth, or sparse.

Inductive biases you use every day

The practical reading. No free lunch does not say all models are equal on your data. Real data is not uniform over all functions. It says your model choice is a bet on structure. Name the bet.

Why it matters in practice

Interview check

Part D — Modern Generalization

9. Double descent and why big nets generalize

Plain definition. Classical theory says test error rises once a model can fit noise. But past the point where it fits the training data exactly, test error can fall again. That second drop is double descent.

The curve

Let p be the number of parameters and n the number of samples. The interpolation threshold is near p = n. That is where the model can first fit the training set exactly.

Parameters p (relative to samples n) → Error classical regime modern, interpolating regime p = n test train peak: one exact fit, huge norm many fits, pick smallest norm
Test error peaks at the interpolation threshold, then falls. Past the peak it can drop below the classical sweet spot.

Why the peak happens

Take least squares with random features Φ of shape n × p. Past the threshold, many weight vectors fit the data exactly. Take the minimum-norm one, β̂ = Φ+y, using the pseudoinverse.

import numpy as np

rng = np.random.default_rng(1)
n, d, sigma = 40, 5, 0.2
X = rng.standard_normal((n, d));   Xt = rng.standard_normal((2000, d))
w = rng.standard_normal(d)
y = np.sin(X @ w) + sigma * rng.standard_normal(n)
yt = np.sin(Xt @ w)

W = rng.standard_normal((d, 1000)) / np.sqrt(d)   # fixed random first layer
relu = lambda z: np.maximum(z, 0)

for p in [5, 20, 35, 40, 45, 60, 100, 300, 1000]:
    Phi, Phit = relu(X @ W[:, :p]), relu(Xt @ W[:, :p])
    beta = np.linalg.pinv(Phi) @ y            # min-norm least squares
    test = np.mean((Phit @ beta - yt) ** 2)
    print(f"features p={p:4d}  test MSE={test:8.3f}  ||beta||={np.linalg.norm(beta):8.2f}")

# features p=  35  test MSE=   1.330  ||beta||=   14.35
# features p=  40  test MSE= 629.267  ||beta||=  341.87   <- p = n, the spike
# features p=  45  test MSE=   2.117  ||beta||=   10.45
# features p= 300  test MSE=   0.912  ||beta||=    1.85
# features p=1000  test MSE=   0.850  ||beta||=    0.98

Watch the norm column. Test error tracks the norm of the solution, not the parameter count. That is the whole story in one line.

Implicit regularization of gradient descent

Nobody calls a pseudoinverse on a neural net. So why would training pick a "small" solution? Because the optimizer has a built-in preference.

Benign overfitting

A model can fit noisy labels perfectly and still predict well. Bartlett, Long, Lugosi and Tsigler (2020) showed when this happens for min-norm linear regression.

Other forms of double descent

Do not overclaim. Double descent does not mean "bigger is always better". It shows up most with label noise and weak regularization. Classical variance still exists. It just is not tied to raw parameter count.

Why it matters in practice

Interview check

10. Distribution shift theory

Plain definition. Distribution shift means test data comes from a different distribution than training data. Every bound above assumed the same D. When that breaks, the bounds say nothing. Different kinds of shift need different fixes.

Three kinds of shift

Write the joint as a product two ways. Each kind of shift holds one factor fixed. Let p be source (train) and q be target (test).

Importance weighting for covariate shift

The target risk is an expectation under q. Rewrite it as one under p, which is where we have data.

Rq(h) = Ex~q Ey|x [ ℓ(h(x), y) ]
      = Ex~p [ (q(x)/p(x)) · Ey|x ℓ(h(x), y) ]     (needs p(x) > 0 wherever q(x) > 0)

Weighted ERM:   minh  (1/m) ∑i w(xi) ℓ(h(xi), yi),     w(x) = q(x)/p(x)

The step works only because y|x is the same in both. You rarely know the densities. So estimate the ratio with a domain classifier.

Train c(x) ≈ P(target | x) on pooled source and target inputs.

w(x) = q(x)/p(x) = [ c(x) / (1 − c(x)) ] · (nsource / ntarget)

Effective sample size:  ESS = (∑ wi)2 / ∑ wi2
import numpy as np

rng = np.random.default_rng(2)
f = lambda x: np.sin(x)
# Source: x ~ N(0, 1). Target: x ~ N(1.5, 0.5^2). Same p(y|x).
xs = rng.normal(0, 1, 5000)
ys = f(xs) + 0.1 * rng.standard_normal(xs.size)
xt = rng.normal(1.5, 0.5, 5000)
yt = f(xt) + 0.1 * rng.standard_normal(xt.size)

def pdf(x, m, s):
    return np.exp(-0.5 * ((x - m) / s) ** 2) / (s * np.sqrt(2 * np.pi))

w = pdf(xs, 1.5, 0.5) / pdf(xs, 0, 1)        # importance weights q(x)/p(x)

def fit_line(x, y, sw):
    A = np.c_[np.ones_like(x), x] * np.sqrt(sw)[:, None]
    return np.linalg.lstsq(A, y * np.sqrt(sw), rcond=None)[0]

for name, sw in [("unweighted", np.ones_like(xs)), ("importance-weighted", w)]:
    b = fit_line(xs, ys, sw)
    mse = np.mean((b[0] + b[1] * xt - yt) ** 2)
    print(f"{name:20s} target MSE = {mse:.4f}")
ess = w.sum() ** 2 / (w ** 2).sum()
print(f"effective sample size = {ess:.0f} of {xs.size}")

# unweighted           target MSE = 0.1127
# importance-weighted  target MSE = 0.0332
# effective sample size = 925 of 5000

A line cannot fit a sine wave everywhere. So the model is misspecified. Weighting tells it to fit the region the target cares about. Target error drops by about 70%. The price is an effective sample of 925 out of 5,000.

Label shift

Here the fix acts on classes, not inputs. If p(x|y) is fixed, Bayes' rule gives a direct correction.

q(y | x) ∝ p(y | x) · q(y) / p(y)

In logit space:  logitq(y | x) = logitp(y | x) + log( q(y) / p(y) )

You need q(y), the new class rates. Target labels are missing, so estimate them.

Concept shift

No reweighting helps, because the labeling rule itself changed. Old labels are now partly wrong.

A bound for domain adaptation

Ben-David et al. (2010) bound target error by three terms.

RT(h) ≤ RS(h) + ½ dHΔH(S, T) + λ*

λ* = minh∈H [ RS(h) + RT(h) ]

Why it matters in practice

Interview check

11. Loss functions and their properties

Plain definition. The loss decides what the model learns. Some losses recover true probabilities. Others only recover the right class. Picking the loss is picking what "good" means.

What each regression loss estimates

The population minimizer of a loss is the target the model chases. For regression the answer is clean.

Proper scoring rules

A scoring rule S(q, y) scores a predicted distribution q against the outcome y. Lower is better here. It is proper if reporting the truth is optimal.

Proper:           Ey~p[ S(p, y) ] ≤ Ey~p[ S(q, y) ]   for all q
Strictly proper:  equality only when q = p

Check two common rules in the binary case. Let p = P(y = 1) and q be the prediction.

Log loss:     L(q) = −p log q − (1−p) log(1−q)
              dL/dq = −p/q + (1−p)/(1−q) = 0   ⇒   q = p      (strictly proper)

Brier score:  L(q) = p (1−q)2 + (1−p) q2
              dL/dq = 2(q − p) = 0                  ⇒   q = p      (strictly proper)

Surrogate losses for classification

We want low 0-1 error. But 0-1 loss is not convex and has zero gradient almost everywhere. So we minimize a convex surrogate φ of the margin z = y f(x), with y in {−1, +1}.

Margin z = y f(x) → −2 −1 0 1 2 3 1 2 3 0-1 loss hinge log (base 2) exponential focal, γ = 2
Surrogates as functions of the margin. Log loss is scaled by 1/ln 2 so all pass through 1 at z = 0. Hinge goes flat at z = 1. Focal loss nearly ignores easy examples.

Hinge versus log versus focal

Hinge loss. φ(z) = max(0, 1 − z). Used by SVMs.

Log loss (logistic, cross-entropy). φ(z) = log(1 + e−z).

Focal loss (Lin et al. 2017). FL(pt) = −(1 − pt)γ log pt, where pt is the probability given to the true class.

Exponential loss. φ(z) = e−z. AdaBoost minimizes it. Its minimizer is half the log odds. It grows fast for negative margins, so label noise hurts it badly.

When is a surrogate safe?

Bartlett, Jordan and McAuliffe (2006) answered this. A surrogate is classification-calibrated if minimizing it also minimizes 0-1 risk. For convex φ there is a simple test.

Convex φ is classification-calibrated  ⇔  φ is differentiable at 0 and φ'(0) < 0

Excess risk transfer:   ψ( R0-1(f) − R*0-1 ) ≤ Rφ(f) − R*φ
                        hinge: ψ(θ) = |θ|        log loss: ψ(θ) ≥ θ2/2

Hinge, log, exponential and squared hinge all pass. So driving surrogate risk to its minimum drives 0-1 risk to its minimum. Hinge transfers linearly. Log loss transfers through a square root, which is weaker for classification but buys probabilities.

Why it matters in practice

Interview check

Recap

← 7 — Research Depth and Behavioral T2 — Statistical Inference →