PAC learning and uniform convergence
Keep confidence, accuracy, realizability and sampling assumptions visible in finite-class guarantees.
On this page
The question for today
What you’ll understand
- State agnostic and realizable PAC guarantees with their distributional quantifiers.
- Derive a finite-class agnostic guarantee from Hoeffding and a union bound.
- Compare the distinct inverse-square and inverse-accuracy sufficient sample sizes.
A PAC guarantee fixes an accuracy tolerance and a failure probability, then asks how much independent data suffices uniformly over the allowed populations. It does not say that every training sample works, or that a high-confidence statement assigns a posterior probability to the chosen predictor. Realizable and agnostic learning use different premises, and their finite-class sample bounds reveal why that distinction matters.
Specify what the learner must achieve
In agnostic binary classification, the distribution on labeled examples is arbitrary and the goal is risk within epsilon of the best rule in a fixed hypothesis class. The learner must meet this goal with probability at least one minus delta over its independent training sample, for every allowed distribution. In the realizable setting, a class member has zero population error. A consistent learner then returns a class member with zero training error, but the premise of a zero-risk class member remains essential to the faster argument.
Classes and losses must be fixed independently of the sample used in the theorem. A class chosen after inspecting labels is not automatically covered by a bound that counts only its final size. The learner’s internal randomness, if any, must also be included in the probability space or handled by a conditioning argument. We use finite nonempty classes and measurable deterministic tie breaking for the explicit bounds, avoiding subtleties about measurable suprema and existence of minimizers.
Uniform convergence handles sample-dependent selection
For any one fixed predictor with loss in[0,1], Hoeffding bounds the probability that its empirical and population risks differ by more than a. A union bound over M predictors gives a simultaneous event. The events for different predictors need not be independent: each predictor’s loss sequence is iid across examples, and the union bound needs no independence across predictors. Exact empirical minimization then has class excess at most twice a on that event by the deterministic comparison already established.
Set a equal to epsilon divided by two and solve for n. The resulting sufficient bound grows like log(M/delta) divided by epsilon squared. It is a guarantee from a particular proof, not a claim that its numerical constant is optimal or that every dataset needs that many observations. If the bound is much larger than an available sample, the calculation is inconclusive rather than proof that learning cannot work. Empirical performance and an absent certificate are different statements.
Consistency permits a different realizable proof
In the realizable binary setting, a hypothesis with population error greater than epsilon is consistent on n independent examples with probability at most , bounded by . A union bound over all bad hypotheses shows that n at least log(M/delta) divided by epsilon suffices for every consistent class member to have small true error. This argument uses actual zero-one errors and consistency, rather than a two-sided uniform approximation of all risks.
The inverse-accuracy bound should not be used for noisy data merely because an expressive class interpolates its training sample. Interpolation is a fact about observed labels, whereas realizability asserts that some rule in the predetermined class makes no errors on the entire population. Enlarging the class until it fits every sample may simultaneously increase its complexity. The sample-size comparison below therefore compares two theorems under different assumptions, not two interchangeable formulas for the same unrestricted problem.
Work it through
The same finite class under two sets of assumptions
For M=100 fixed binary hypotheses, epsilon=0.10 and delta=0.05, compute sufficient sample sizes for the displayed agnostic ERM bound and the realizable consistent bound.
For agnostic ERM, use .
Round upward to 1659 observations. This makes the simultaneous deviation event strong enough to give class excess at most 0.10 with confidence at least 0.95.
Under the additional realizability premise, consistency instead needs , so 77 observations suffice for that separate theorem.
Sufficient sizes are 1659 in the agnostic argument and 77 in the realizable argument. Zero training error alone does not justify choosing the smaller number.
The living notebook
Explore the model
Interactive lab · probability
A bad rule can accidentally fit a sample
Pause and Reset, then set error probability p = 0.10 and trials n = 20. Predict that a fixed rule with true error 0.10 makes no sample errors with probability 0.9²⁰≈0.1216, despite positive risk. Reset and set both p = 0.10 and n = 30: predict zero-error probability 0.9³⁰≈0.0424. The bars concern one fixed rule; they do not union-bound an adaptive search or simulate a realizable target.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forConsistency on finitely many examples is compatible with positive population error.
Pause & reason
Check your understanding
Your turn
Try it yourself
Repeat both sufficient-size calculations for M=20, epsilon=0.20 and delta=0.10. State the roles of epsilon and delta.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Use natural logarithms and round the final sample sizes upward, rather than rounding the logarithm first.
Compare with the solution
The agnostic bound is , so n=300 suffices. The realizable bound is , so n=27 suffices under realizability and consistency. Epsilon controls the allowed excess or classification error; delta controls how often the guarantee may fail over independently drawn samples. A confidence of 0.90 does not assert that each individual prediction is correct with probability 0.90, and it does not change the reference class against which excess risk is measured.
Keep the idea
Take it with you
- PAC quantifiers range over populations and random training samples.
- Finite-class uniform convergence supports sample-dependent ERM selection.
- The faster consistency bound requires population realizability rather than observed interpolation alone.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.