Consider a ground set . Let the space of all possible binary classifications be the function space . Now, a hypothesis class is a subset of . For example, some model such as "return if a point is inside a region, otherwise" is a subset of the full class .
The VC dimension of measures how good is generating different classification. We first need the notion of shattering to define this.
A subset of the ground set shatters a hypothesis class if the function has full range, where is defined as:
That is, the hypothesis class can classify all the subsets of .
Now the VC dimension of the hypothesis class of a ground set is the size of largest possible such that is shattered by .
§ Correct interpretation
- We need just one set of size to be shattered by . We get to pick the set .
§ Subtletly 1:
- We do not need all sets of size to be shattered by .
We can have the case where:
- All sets of size 3 are shattered by H
- Only one set of size 4 is shattered by H. All other sets of size 4 are not.
- Only one size of size 5 is shattered by H. All other sets of size 5 are not.
- No set of size 6 is shattered by H.
In this case, the VC dimension of is 5, not 3 .
§ Subtletly 2:
We cannot have the case where:
- All sets of size 3 are shattered by H
- No set of size 4 is shattered by H
- Some set of size 5 is shattered by H
For contradiction, let be the set of size that is shattered by . Let , . Now, shatters since shatters . Hence, Some set of size 4 has been shattered. Contradiction, since we assumed that no set of size 4 is shattered by .
So, to prove that sets of size cannot be shattered, it suffices to prove that sets of size equal to cannot be shattered.
§ Growth of number of sets shattered in for for a fixed .
If we fix a hypothesis class for , and we want to understand how varies over subsets of , the idea is this:
Let be a set that is the maximum sized set that is shattered by . ie, and shatters .
Now, the idea is this:
- For subsets , -- exponential.
- For subpersets , -- polynomial.
We can show that this exponential/polynomial behaviour happens in general for .