MIT 6.790 — Lecture 11
PAC and VC Dimension
§ Probably Approximately Correct (PAC)
The result from the end of Lecture 10 inspires the following definition.
Definition. For and , a learning algorithm that takes training data and outputs a hypothesis is -PAC if:
where, as before, we denote .
Think of as an accuracy parameter that represents the difference between the learned and optimal hypotheses and .
Think of as a confidence parameter that represents the chance that our data misrepresents the actual data distribution.
Example. The result from Lecture 10 says that, if the risk function has a loss function satisfying , then the ERM learning algorithm is -PAC.
§ PAC-Learnable
Definition. A hypothesis class is PAC-learnable if there exists a learning algorithm that takes training data and outputs a hypothesis such that the following is true for any and .
There exists a constant such that, no matter what the data distribution, is -PAC whenever .
Example. The result from Lecture 10 says that any finite hypothesis class is PAC-learnable (assuming a bounded loss function). In particular, in this case we have .
The assumption of “bounded loss” in the above example actually turns out to be pretty much required.
Fact. If the loss function is unbounded, then it turns out almost nothing is PAC-learnable.
Justification: Let's consider the simplest nontrivial case: . Then consider the following distribution on .
- (a)
With very small probability , we sample for which and , where .
- (b)
With very large probability , we sample for which .
Then no matter how large an we pick, we can set small enough so that almost always hits case (b). Then it is impossible for the learning algorithm to learn that is the better hypothesis.
Thematically, the reason why unbounded loss leads to PAC-unlearnability is that unbounded nonnegative random variables can have means that are impossible to bound given only finitely many samples.
The conclusion, then, is that we might as well assume the loss function is bounded. We should also direct our attention to infinite hypothesis classes , as all the finite ones are automatically PAC-learnable under this assumption.
§ Growth Functions: Motivation
From now on, we'll specifically consider the case when our hypotheses are binary classifiers . Even still, proving or disproving PAC-learnability for infinite hypothesis classes seems hard.
Remark. This subsection and the next will take a step back from PAC-learnability for a while. Just have trust that all of this setup will eventually prove itself incredibly useful for deciding whether an infinite hypothesis class is PAC-learnable or not.
Suppose is the size of our training data . Then there are only so many ways a hypothesis can perform in the training process. The training data acts like an -question true-or-false exam, so there are at most ways a hypothesis could perform. Our learning algorithm should pick the hypothesis that scores the highest.
But if two hypotheses score the highest… well, then we haven't learned enough. It's possible that our learning algorithm outputs , whereas the true optimal hypothesis is . And maybe on the real test data, the output performs horribly in comparison to . We'd have no way of knowing, because and performed the same in the training exam.
§ Growth Functions: Definition
To formalize the idea of multiple hypotheses ending up indistinguishable in training, it helps to count the number of possible ways a hypothesis can perform on our -question true-or-false exam.
Definition. Given a training set , let denote the set of all possible labelings of points in by some hypothesis in ; that is,
Definition. Define to be the growth function of .
Example. In the worst case, we have for all . This represents the scenario in which multiple hypotheses are the highest-scoring, making it impossible to pick out a PAC hypothesis.
Remark. By definition, is impossible.
Problem. Determine the growth function of .
Solution: Suppose the training set is , in that order. Then there are only ways a hypothesis in could label these points; one such way is pictured below.

Problem. Let be the class of all two-dimensional linear classifiers. Compute and .
Solution: The picture below demonstrates that and is achieved by any three points in general position.

Interestingly, does not equal . If the four points of our data set are taken to be the vertices of a square, then not all labelings of those vertices are achievable by a linear classifier.

Infamously, as shown above, the XOR cannot be modeled by a linear classifier, and instead of . (To prove this, we would have to check that no other arrangement of four points gives more than achievable labelings.)
§ VC Dimension
Shockingly, as the following theorem states, there are only two types of growth functions.
Theorem. (VC Dichotomy) For any hypothesis class , either:
We have for all .
We have for all , for some constants and .
Remark. Note that this theorem is fundamentally a set-theoretic result! Nothing about its statement requires any mention of a probability distribution or machine learning at all.
This inspires the following definitions.
Definition. A training set is shattered by a hypothesis class if . The VC-dimension of a hypothesis class is the size of the largest subset of that is shattered by .
Example. If is such that for all , then its VC-dimension is infinite. Meanwhile,
The VC-dimension of the hypothesis class from earlier is .
The VC-dimension of the class of all two-dimensional linear classifiers is .
More generally, you can check that the VC-dimension of the class of all -dimensional linear classifiers is .
Remark. You might notice that the VC-dimension of each of these examples happens to equal the number of parameters associated with its hypothesis class. Please note that this does not hold in general.
§ Results: Identifying PAC-Learnability
Now we can finally get back to PAC-learnability! Let's state (without proof) some results using our newfound definitions.
Theorem. (ERM VC Risk Bound) Under the ERM learning algorithm, the following holds with probability at least .
It also turns out that the exponent in the bound relates to the VC-dimension!
Theorem. (Sauer-Shelah-Perles) If a hypothesis class has finite VC-dimension , then for all we have:
In particular, this implies that , so the degree of polynomial growth of is bounded by .
Remark. Again, the above theorem is purely set-theoretic. It upper-bounds the size of a collection of subsets for which no elements of are shattered. (The 6.790 notes offer a proof, but I believe it is a fakesolve.)
Putting the previous two theorems together yields the Fundamental Theorem of Statistical Learning.
Theorem. (Fundamental Theorem) A hypothesis class is PAC-learnable if and only if it has finite VC-dimension.
If its VC-dimension is finite, then, with probability at least , we furthermore have:
Expectedly, the RHS tends to zero as grows large, confirming PAC-learnability.
Yippee! And so all those hypothesis classes we discussed earlier are now proven PAC-learnable.