PAC Learning
Agnostic learning is needed when that perfect agreement cannot be assumed.
Try it: Empirical Risk Minimization
How ERM picks the hypothesis in a finite class H with the smallest empirical risk on a random sample , how far its true risk can be from , how often ERM misses ε over many samples compared with the finite-class sample-complexity bounds, and how a richer class trades approximation error for estimation error until memorising the sample overfits.
How it works
- D is known: x is uniform over n points in [0, 1] and its label is a target rule f (a threshold or an interval), flipped with probability η; so every can be computed exactly.
- Draw : independent labelled examples from a seeded random stream.
- For every h in H (thresholds or intervals on a grid, listed in order), count its mistakes on S to get , and compute its true risk from . For the class of all functions, ERM simply memorises S: the majority label at each seen point, 0 elsewhere.
- ERM returns , the first hypothesis with the smallest . Compare with , and split into plus .
- Repeat with R fresh samples and count how often . The finite-class bound says (realizable, ) or (agnostic, ) keeps that frequency at most δ.
- Run the same samples through richer and richer classes: falls, the average rises, and memorising (all functions) reaches small with a large .
Default run (16 steps): D: x uniform over 20 points in [0, 1], label f(x) = 1[x >= 0.4] flipped with probability η = 0.1. H = thresholds on the grid i/10, |H| = 11. The learner never sees D; it gets S ~ Dm with m = 20. … Richer classes on the same 200 samples: ε_app falls from 0.42 (thresholds, k = 1) to 0.1 (all functions), while the average ε_est rises to 0.2282 for all functions (average LS 0.0617). Lowest average LD(hS): thresholds, k = 5 (0.1136).
Simplified: A toy domain of 8-40 equally likely points on a line, a target that is a threshold or an interval, and symmetric label noise, so is an exact finite sum rather than an integral over a continuous distribution. Hypotheses are thresholds or intervals with endpoints on a grid i/k, or all functions on the n points. ERM ties are broken towards the first hypothesis in listing order (for all functions: towards label 0), where the textbook allows any minimiser. Failure frequencies come from at most 400 seeded samples, so they estimate the probability rather than compute it; the bounds use the natural logarithm.
Loading the simulation…
When Perfect Labels Fail
A traditional learning model often assumes that the features of every input determine one correct label with complete certainty. Under this assumption, there is a target labeling function, and some hypothesis in the class H agrees perfectly with that function. This is the realizability assumption. It makes learning conceptually clean: the learner searches for a hypothesis that makes no errors on the underlying labeling rule. Practical data, however, may not satisfy this assumption. Measured features may fail to capture everything that influences a label, so the same feature description can be associated with different labels. Agnostic PAC learning removes the requirement that one hypothesis represent the data perfectly.
A Joint View of Data and Labels
Agnostic PAC learning describes data generation with a joint data-labels distribution over X × Y. Here, X represents the domain of possible feature descriptions and Y represents the possible labels. A joint distribution assigns likelihood to combinations of a domain point and a label. It therefore describes the two parts together: which point appears and which label accompanies that point.
Papaya features and taste labels
Separate the questions answered by a distribution over papaya feature descriptions and taste labels.
- 1Start with a feature description
Treat a papaya's measured features as a domain point x in X.
- 2Pair the point with a label
A joint outcome is a pair consisting of that feature description and a taste label. The distribution describes how likely that pair is.
- 3Allow repeated feature descriptions
The same feature description can occur with different labels in an agnostic model. The data-labels distribution records the probabilities of the different pairs rather than requiring one label to be correct with complete certainty.
- 4Separate occurrence from labeling
The probability that the feature description appears is a marginal question. The probability of each taste label after that feature description is known is a conditional question.
The joint distribution gives one model for both which feature descriptions occur and how labels are associated with them.
The diagram does not say that a single observation simultaneously has two labels. It shows that the same domain description can participate in different possible domain-label outcomes under the data-generating distribution. This is precisely what the realizability assumption rules out when it requires one correct label for each input description.
Marginal and Conditional Questions
| View | Question it answers | What it describes |
|---|---|---|
| Marginal distribution | Which domain points are likely to appear? | The distribution over domain points after labels are not the focus |
| Conditional probability | Given a particular domain point, how likely is each label? | The label possibilities associated with that point |
| Joint distribution | How likely is a domain point-label pair? | The data point and its label together |
The marginal and conditional views answer different questions, while the joint distribution describes them together.
Suppose the domain point is a papaya feature description. The marginal distribution asks how likely that feature description is to appear at all. It does not, by itself, answer which taste label accompanies the point. The conditional probability asks the second question: once the feature description is fixed, how likely is each label? Keeping these questions separate prevents a common misunderstanding. A point can be common or rare independently of whether its labels are concentrated or varied.
ERM and the Agnostic Goal
In agnostic PAC learning, the learner does not assume that the data can be represented perfectly by a hypothesis in H. The target therefore changes. Instead of requiring zero error, the learner seeks a hypothesis whose performance is close to that of the optimal hypothesis in H. This comparison is important: the learner is judged against the best available member of the chosen hypothesis class, not against a perfect hypothesis that may not exist.
Why ERM needs a theorem
Explain why selecting the hypothesis with the smallest empirical risk is not, by itself, enough to establish agnostic PAC learning.
- 1Observe the sample
The learner receives a finite labeled sample from the joint data-labels distribution.
- 2Compute empirical risk
ERM evaluates how each hypothesis performs on the observed sample and chooses a hypothesis with the smallest empirical risk.
- 3Connect sample performance to distribution performance
The desired agnostic guarantee concerns true risk, not only performance on the observed sample. A theorem is needed to relate empirical risk to true risk.
- 4Compare with the class optimum
Once the empirical and true risks are controlled together, the ERM output can be shown to perform close to the optimal hypothesis in H.
ERM supplies the selection procedure; the risk-comparison argument supplies the learning guarantee.
Uniform Risk Control
Theorem 26.5 provides a uniform risk comparison for every hypothesis in the class. Its role is to control the difference between true risk and empirical risk, not merely for the hypothesis eventually selected by ERM, but for all hypotheses in H at once. This uniform statement is what allows the proof to analyze the data-dependent choice made by ERM. Without such a connection, a hypothesis could look best on the observed sample without the analysis establishing that it is close to the best choice under the underlying distribution.
The proof considers the possibility that a hypothesis has a substantial difference between its true risk and empirical risk. Theorem 26.5 supplies the relevant comparison for each hypothesis. The union bound then controls the probability that any of the relevant failure events occurs. The result is a statement that the comparison holds simultaneously across the hypothesis class, with a controlled probability of failure.
Common mistake Treating the theorem as a guarantee only for the ERM output.
What it looks likeThe learner chooses a hypothesis after inspecting the sample, and the proof analyzes only that chosen hypothesis.
Why it failsThe chosen hypothesis depends on the sample. A guarantee stated uniformly for every hypothesis is what allows the proof to cover the data-dependent ERM choice.
Do this insteadUnderstand Theorem 26.5 as a simultaneous comparison across H before focusing on the hypothesis selected by ERM.
Common mistake Assuming the union bound makes every individual failure event impossible.
What it looks likeThe proof combines failure events and concludes that each event has probability zero.
Why it failsThe union bound controls the probability of the combined event; it does not assert that every component event is impossible.
Do this insteadUse it to bound the probability that at least one relevant comparison fails.
Common mistake Confusing empirical risk with true risk.
What it looks likeA hypothesis has the smallest observed-sample risk, so it is declared optimal for the distribution.
Why it failsEmpirical risk is based on the sample, while the agnostic objective concerns performance under the data-generating distribution.
Do this insteadUse the uniform risk comparison to connect the two quantities.
Why Sample Size Matters
An upper-bound proof for agnostic PAC learnability establishes that there is a sufficient sample complexity for achieving the desired comparison with the optimal hypothesis in H. The sample-size condition is needed because the proof must make the final error small enough, typically below a chosen epsilon. The source material does not provide the literal algebraic expression for that sample complexity. The justified structural conclusion is that the proof first obtains a uniform risk bound, combines the relevant failure events with the union bound, and then imposes the sufficient condition from Lemma A.2 so the final error is below epsilon.
Uniform risk bound established Union bound applied Sufficient sample-size condition not imposed
The proof has intermediate controls but no final sufficient condition.
Uniform risk bound established Union bound applied Lemma A.2 condition imposed Final error below epsilon
The proof reaches the desired agnostic PAC conclusion.
Practice: Trace the Proof
What do you think happens?
A learner uses ERM and selects the hypothesis with the smallest empirical risk. What additional argument is needed before calling this an agnostic PAC learner?
Reveal answer
A comparison connecting empirical risk with true risk for the hypotheses under consideration
ERM minimizes empirical risk, but agnostic learning evaluates performance relative to the data-generating distribution. Theorem 26.5 supplies a uniform risk comparison, and the union bound controls the combined probability of failure.
A feature description x can be associated with labels y1 and y2 under a data-labels distribution. Identify which question belongs to the marginal distribution and which belongs to the conditional probability: how often x appears, and how likely y1 is once x is given.
Hints
- The marginal view focuses on domain points.
- The conditional view focuses on labels after a particular point is fixed.
Put these proof moves in order: impose a sufficient sample-size condition, apply ERM to empirical risks, obtain a uniform true-versus-empirical risk comparison, and use the union bound to control the combined failure probability.
Hints
- ERM is the learner's selection procedure.
- The union bound combines failure events.
- The sufficient condition is used for the final error target.
Key Takeaways
- 1Realizability requires some hypothesis in H to agree perfectly with a target labeling function, an assumption that may fail when measured features do not completely determine labels.
- 2Agnostic PAC learning uses a joint distribution over domain points and labels, allowing the same domain point to be associated with different possible labels.
- 3The marginal distribution describes which domain points occur, while the conditional probability describes labels given a particular point.
- 4ERM selects a hypothesis with the smallest empirical risk, but Theorem 26.5 is needed to connect empirical risk with true risk uniformly across H.
- 5The union bound controls combined failure events, and a sufficient sample-size condition ensures that the final error is below epsilon.
At a glance
- Realizability demands perfect agreement between a hypothesis in H and a target labeling function; agnostic learning does not make that demand.
- A joint data-labels distribution describes domain points and labels together and can assign different label possibilities to the same domain point.
- The marginal distribution concerns which points occur, while conditional probabilities concern labels given a point.
- ERM provides the selection rule, while Theorem 26.5, the union bound, and a sufficient sample-size condition provide the agnostic PAC guarantee.