PAC Learning and Hoeffding's Inequality
In questa pagina 4
Source note. The word "PAC" appears in the course source only in the Moodle chapter pointers (Understanding Machine Learning, PAC learning and Hoeffding); the handwritten lecture shows one result, the finite-hypothesis bound, with the probability tools needed to obtain it. This note contains exactly that, and nothing of the general PAC definition.
Context: The Statistical Learning Framework and Empirical Risk MinimizationA hypothesis is judged by an error function computed pointwise on the data and averaged: the in-sample (empirical) error E_in(h) = (1/N) sum of e(f(x_i), h(x_i)); with squared differences it is the sum of squared errors. The learning algorithms of the course all search the hypothesis set for the h with small in-sample error, but what matters is the error on new inputs drawn from the same input distribution, so the data must cover the regions where the inputs live, and part of the data must be held back to check the result.The Statistical Learning Framework and Empirical Risk Minimization → defines the in-sample error ; here we ask when it can be trusted as an estimate of the error on all inputs, .
1. The result
The page opens with the claim (with a question mark: it is the goal of the derivation) that, for a hypothesis set with hypotheses and samples,
Reading of the symbols: is the hypothesis returned by the learning algorithm, its error on the samples, its error over the whole input distribution, the tolerated gap. The handwriting of the first error term is ambiguous (subscript "in" or "N"); it is read as , the only reading consistent with the rest of the notes.
2. Probability tools used
Events. The sample space is . A simple event is a single outcome; a compound event is a set of outcomes. For two simple events (they cannot happen together)
For two compound events, which can share outcomes (the hatched overlap in the drawing),
The last inequality holds because . Extended to many events this is the union bound:
The union bound is an equality when the events are disjoint (the first sketch of with four separate regions ), and it overestimates the probability when the events overlap strongly (the second sketch, with four heavily overlapping regions).
Hoeffding's inequality (one hypothesis). The notes picture four "bins" filled with green and red marbles, one for each hypothesis. For a single bin let be the true fraction of one colour and the fraction observed in a sample of marbles. Then, for every ,
Translated to learning: a fixed hypothesis plays the role of a bin, "marble of the bad colour" means " errs on this input", is measured on the samples and is . (This identification is my reading of the sketch: the page writes the two symbols next to the bins and then the error bound.) The inequality is stated, not proved, in the notes; it belongs to the family of tail bounds of Markov and Chebyshev InequalitiesFor a nonnegative random variable P(X >= a) is at most E(X)/a (Markov), and for any random variable with finite mean and variance P(|X - E(X)| >= eps) is at most var(X)/eps^2 (Chebyshev); both bounds are loose but universal, valid whatever the distribution.Markov and Chebyshev Inequalities →.
3. From one hypothesis to hypotheses
The algorithm chooses after looking at the data, so may be any of the hypotheses and the bound for a single fixed is not enough. Let be the "bad" event
If the gap for exceeds , then at least one of has happened, so by the union bound
In the handwritten page the final expression is rewritten from to , circling the factors "2" and "M". The sketch of two lines with the thin wedge between them shows why the bound is loose: two similar hypotheses make their bad events almost the same event, so counting both (the factor ) is pessimistic.
4. What the formula says
Read directly from the bound (these remarks are mine, not on the page):
- the probability of a large gap shrinks exponentially in : more samples make a reliable estimate;
- it grows only linearly in : a bigger hypothesis set weakens the guarantee slowly;
- to have the right-hand side equal to a chosen one needs (solve for ).
The bound applies to a finite hypothesis set. The hypothesis sets of the later notes (all lines , all parabolas) are infinite; for them the notes do not give a bound, and the practical tool becomes the test-set estimate of Model Selection and Validation - Hold-Out, k-Fold and Statistical TestsTo decide which of two models is better, fix their hyper-parameters, train each on a training set (this fits the parameters, the vector w or theta) and measure a performance score such as F1 on a separate test set; one split is too fragile, so the hold-out is repeated K times (or K-fold cross-validation is used) and the paired scores of the two models are compared with a statistical test. The null hypothesis H0 is that the two models perform equally; the significance level alpha is fixed before the experiment, and the p-value is the probability of observing the obtained differences under H0. Parametric test: t-test; non-parametric: Wilcoxon.Model Selection and Validation - Hold-Out, k-Fold and Statistical Tests →.
Versione ripasso
- Goal: for hypotheses and independent samples,
- Events: . Union bound: ; equality for disjoint events, loose for overlapping ones.
- Hoeffding (one fixed hypothesis): , with the sample fraction (like ) and the true fraction (like ).
- Why : is chosen after looking at the data, so any may be . If the gap of is large, some happened: probability .
- Reading: exponentially small in ; linear in . Two sketches: a bin filled with green and red marbles per hypothesis (Hoeffding); two similar hypotheses with a thin wedge between them, where the union bound is pessimistic.
- Simple event: one outcome; compound event: set of outcomes; the hatched overlap in the drawing is subtracted once in the two-event formula. For a right-hand side equal to : .
- Only finite hypothesis sets; for infinite sets the notes give no bound.
- Typical errors: using the single-hypothesis bound (without the factor ) for a chosen from the data; mixing (the gap) with (the probability).
- Setting: The Statistical Learning Framework and Empirical Risk MinimizationA hypothesis is judged by an error function computed pointwise on the data and averaged: the in-sample (empirical) error E_in(h) = (1/N) sum of e(f(x_i), h(x_i)); with squared differences it is the sum of squared errors. The learning algorithms of the course all search the hypothesis set for the h with small in-sample error, but what matters is the error on new inputs drawn from the same input distribution, so the data must cover the regions where the inputs live, and part of the data must be held back to check the result.The Statistical Learning Framework and Empirical Risk Minimization →; tail bounds: Markov and Chebyshev InequalitiesFor a nonnegative random variable P(X >= a) is at most E(X)/a (Markov), and for any random variable with finite mean and variance P(|X - E(X)| >= eps) is at most var(X)/eps^2 (Chebyshev); both bounds are loose but universal, valid whatever the distribution.Markov and Chebyshev Inequalities →.