Hypothesis Classes in Machine Learning
Shattering is an all-labelings requirement, not a one-labeling test.
The Flexibility Question
When studying a hypothesis class, the important question is not simply how many hypotheses the class contains. The more useful question is how flexibly its hypotheses can label a finite collection of points. For axis-aligned rectangles, the decisive boundary is between four points and five points.
The final result is a sharp boundary: an appropriate set of four points can be shattered, but no set of five points can be shattered.
What Shattering Requires
A hypothesis class shatters a finite point set when, for every possible assignment of binary labels to those points, some hypothesis in the class realizes that assignment. For four points, this means realizing all 16 possible labelings, including the labeling in which all four points receive 1, the labeling in which all four receive 0, and every mixed assignment between them.
Rectangle-Induced Labels
An axis-aligned rectangle acts as a hypothesis for labeling points in two-dimensional space. After a rectangle is chosen, each point receives a binary label according to the rectangle's inclusion rule: the selected rectangle determines which points are labeled 1 and which points are labeled 0. Moving, resizing, or repositioning the rectangle changes the labeling it produces. The question is whether the available rectangle choices can produce every requested labeling of a particular point set.
The visual shows the central mechanism: the point set stays fixed while the chosen rectangle changes. A class shatters the set only if suitable choices are available for every binary labeling, not merely for the two labelings shown in one illustration.
The Four-Point Lower Bound
Showing that four points can be shattered
Show what must be established to prove that the VC-dimension of axis-aligned rectangles is at least 4.
Choose an appropriate four-point set: The lower-bound proof begins by exhibiting a set of four points for which rectangle choices can realize every binary assignment.
Include the extreme labelings: The rectangle class must realize the labeling in which all four points receive 1 and the labeling in which all four points receive 0.
Include every mixed labeling: It must also realize every assignment containing both labels. For four points, the complete collection contains 16 possible labelings.
Conclude the lower bound: Because every labeling of this four-point set can be realized by a suitable axis-aligned rectangle, the class shatters four points.
The VC-dimension is at least 4.
This is an existence argument. It is enough to exhibit one suitable set of four points whose complete set of labelings can be realized. The proof does not require every possible arrangement of four points to have this property.
The Five-Point Obstruction
What do you think happens?
For an arbitrary set of five points, which labeling can be used to show that the set is not shattered?
Reveal answer
Answer: Label the leftmost, rightmost, lowest, and highest points 1, and label the remaining point 0.
The source argument identifies those four extreme points. An axis-aligned rectangle cannot realize the requested combination, so this labeling is missing from the class's realizable labelings.
The upper-bound proof works for any set of five points. Identify a leftmost point, a rightmost point, a lowest point, and a highest point. Label these four points 1 and label the remaining point 0. An axis-aligned rectangle cannot realize this requested labeling. Therefore, every five-point set has at least one labeling that the rectangle class cannot produce.
The proof does not need to identify the same missing labeling for every five-point set. It gives a rule that works for any such set: use the four named extreme points as the positive points and the remaining point as the negative point.
Common Reasoning Errors
Testing only one labeling
Shattering requires every possible labeling of the point set to be realizable.
Fix:
Check the complete collection of labelings, including all-0, all-1, and every mixed assignment.Using only the four-point construction
That establishes only the lower bound. It does not rule out the possibility that five points or more can also be shattered.
Fix:
Add the five-point obstruction to establish the upper bound.Assuming any five-point labeling is impossible
The upper-bound argument requires only one unrealizable labeling for each five-point set.
Fix:
Identify the leftmost, rightmost, lowest, and highest points, label those four 1, and label the remaining point 0.Counting hypotheses instead of testing label flexibility
The relevant question is how flexibly the class labels finite point sets.
Fix:
Use shattering and the four-point/five-point boundary.
Check Your Understanding
Suppose you are given five points and asked whether axis-aligned rectangles shatter them. Describe the labeling you would test first, and explain why failure on that one labeling is enough to reject shattering.
Hints
- Identify the leftmost, rightmost, lowest, and highest points.
- Give those four points label 1 and the remaining point label 0.
- A set is shattered only when every labeling is realizable.
A complete VC-dimension argument
Use the four-point construction and five-point obstruction to determine the VC-dimension.
Lower bound: An appropriate set of four points can be shattered, so the VC-dimension is at least 4.
Upper bound: Every set of five points has a labeling that no axis-aligned rectangle can realize, so no five-point set can be shattered.
Combine the bounds: The lower bound reaches 4, while the upper bound prevents the value from reaching 5.
The VC-dimension of axis-aligned rectangles is exactly 4.
Exact Boundary
- Shattering means realizing every possible binary labeling of a point set, not merely one selected labeling.
- An axis-aligned rectangle is evaluated by the binary labeling it assigns to points in two-dimensional space.
- An appropriate set of four points can be shattered, giving a lower bound of 4.
- For any five points, labeling the leftmost, rightmost, lowest, and highest points 1 and the remaining point 0 produces an unrealizable labeling.
- The VC-dimension of axis-aligned rectangles is exactly 4.
Key Takeaways
- Shattering is an all-labelings requirement.
- Four points can be shattered by axis-aligned rectangles for an appropriate point arrangement.
- Every five-point set has a labeling that axis-aligned rectangles cannot realize.
- The four-point lower bound and five-point upper bound meet, establishing VC-dimension 4.