Previous: prediction and consistency · Next: linear classifiers and SVMs
Source: Lectures 9-13, pp. 31-46.
Part 1 estimated conditional probabilities and then classified. We now choose a predictor with small observed loss. The difficulty is that we select the predictor using the same sample on which we measure its error.
1. Why unrestricted training-error minimization fails
Under 0-1 loss,
Although Bayes minimizes , minimizing over all functions can overfit.
Suppose has a density. Surround the distinct training inputs by disjoint balls whose union has probability at most . Define
Every label is memorized, so . Outside , the conditional error is . Thus
This is a counterexample, not an implementable algorithm: using the unknown Bayes rule shows that low training error alone does not identify a good predictor.
2. Restrict to a hypothesis class
Choose a fixed class , such as affine half-space classifiers. Distinguish
These are the best training fit, best population fit within the class, and unrestricted optimum. We write minimizers when they exist; infima and approximate minimizers give analogous bounds with an optimization-error term.
We want to compare with its training error, with , and with Bayes risk .
Uniform convergence
Define
First, . For the second comparison, add and subtract empirical risks:
The middle term is nonpositive because minimizes training risk.
A bound for one fixed is insufficient: choosing after seeing the data changes the independence argument. A bound uniform over a predetermined class covers the selected predictor too.
Approximation error remains
The first term controls estimation error. The second measures how well the class represents an optimal rule. A richer class can reduce approximation error while making estimation harder.
Clarification of the lecture’s consistency statements: uniform convergence implies consistency relative to the best predictor in . Bayes consistency additionally requires approximation error to vanish. Necessity statements in VC learning theory involve distribution-free quantifiers; a pointwise claim for one distribution is not the full equivalence.
3. Finite classes: Hoeffding and a union bound
For fixed , the losses are independent and bounded in , so
If , a union bound gives
Set and solve:
With probability at least , this bounds , and twice this quantity bounds the ERM excess risk within the class.
For infinite classes, cardinality is too crude: different functions can behave identically on a finite sample.
4. Shattering and the growth function
Lectures 10-11; pp. 36-39.
For inputs , define
The growth function, or shattering number, is
A set is shattered when every binary labeling can be realized. The supremum ranges over arrangements; one unshatterable arrangement does not establish a bound on .
Affine classifiers in the plane
- One point admits both labels: .
- Two distinct points admit all four labelings: .
- Three collinear points cannot realize in their linear order. Three noncollinear points can realize all eight labelings, so .
- Four points cannot be shattered. Alternating labels on a convex quadrilateral cannot be separated by a line. If one point lies in the convex hull of the others, it cannot be separated from all the others. Degenerate arrangements also fail.
Thus affine half-spaces in have VC dimension 3.
Deriving the VC probability bound
The lecture states, for ,
The following steps explain the independent-copy argument behind it.
1. Introduce a ghost sample. Let be independent, with empirical risk . For a function selected using , its ghost risk has conditional variance at most . Chebyshev gives
If a training sample exhibits deviation at least , with probability at least the ghost risk is within of population risk. The two empirical risks then differ by at least . With the usual measurability and supremum-approximation details,
2. Randomly swap paired observations. Swapping with independently leaves the joint distribution unchanged. Conditional on the pooled observations, the difference becomes
where are independent random signs. Each summand has range width at most 2. Hoeffding bounds the probability of deviation for one labeling by .
3. Count behaviors. At most label vectors occur on the pooled inputs. A union bound contributes this factor; Step 1 contributes another factor 2. This gives the displayed VC inequality.
Solving for failure probability yields
with probability at least . Exponential growth of need not give a shrinking bound, so we next control that growth.
5. VC dimension controls growth
Define
The Sauer-Shelah lemma, stated in the PDF, gives
For , this is at most . The restriction matters; this expression is not a bound for arbitrary smaller .
Substitute into the probability bound:
For fixed finite , makes the bound vanish. Taking makes failure probabilities summable; Borel-Cantelli then gives almost-sure uniform convergence.
Examples and empirical distribution functions
Affine half-spaces in have VC dimension . Thresholds have VC dimension 1: one point is shattered, but two ordered points cannot receive labels .
Applied to threshold averages, uniform convergence says
This is the Glivenko-Cantelli property. To express it literally as a classification risk, take the constant label , so the threshold indicator equals its loss.
VC dimension measures worst-case input arrangements. Rademacher complexity uses the observed inputs or their distribution.
6. Rademacher complexity
Lectures 11-13; pp. 39-46.
Switch to labels and classifiers in . Independently of the sample, draw with equally likely values and . Define
Empirical complexity measures how well the class can align with random labels on the observed inputs.
For a singleton , linearity and give complexity 0. If the class shatters the distinct sample inputs, choose to get
No correlation exceeds 1, so empirical complexity is exactly 1 in this case. Repeated inputs cannot always fit contradictory random labels.
Step 1: symmetrization with a ghost sample
To handle absolute values correctly, define two signed suprema:
Then . Since , moving the supremum outside the ghost expectation gives
For our label convention,
Consequently,
Step 2: introduce random signs
Swapping each observation with its ghost partner independently leaves the joint law unchanged. Therefore
The last inequality uses .
Step 3: absorb the labels
Conditional on all inputs and labels, multiplying an independent symmetric sign by a fixed leaves it symmetric. The signs remain independent. Both expectations above thus equal , giving
Reversing the two samples proves .
Correction to pp. 43-46: symmetry of the signs alone does not allow removal of an absolute value inside a supremum. A singleton has signed complexity zero but need not have zero expected absolute random correlation. The two signed-supremum argument avoids that step.
Step 4: concentration around expectation
Replacing one training observation changes by at most for every . Since
each has bounded differences . McDiarmid gives
Union-bound the two events and take . With probability at least ,
These constants follow from the stated convention; the PDF displays looser constants.
Step 5: use empirical complexity
Replacing one input changes a random correlation by at most . Taking suprema and sign expectations preserves this bound, so has bounded differences . Its lower-tail bound is
Combine this with the two events from Step 4. Set so the total failure probability is at most . Then
The extra term pays for estimating distribution-dependent complexity using the observed inputs.
7. Estimation in practice and the conclusion
For the fixed inputs:
- Draw independent random-label vectors .
- Solve for each vector.
- Approximate empirical complexity by .
This is ERM with random labels because
Generating labels is cheap; optimizing can be expensive. A heuristic optimizer can underestimate the supremum, so it does not by itself provide a certified complexity upper bound.
If for a given distribution, summable failure probabilities imply almost surely. ERM reaches the best risk within . For a universal statement, the condition must hold for every distribution. For Bayes consistency, approximation error must also vanish.
Local methods estimate and use consistency arguments; ERM methods control uniform deviations through class complexity. We now choose concrete classes and objectives: continue to Part 3.