Concepts / Uniform Convergence

Uniform Convergence

Uniform convergence studies this effective expressiveness by restricting the class to finite sets of instances and counting the different binary labelings that the hypotheses can produce there.

  • Programming
Interactive lab

Try it: Shattering and VC Dimension

What it means for a hypothesis class to shatter a set of points: all labelings are checked exactly, each realizable one with a witness hypothesis drawn, until the first labeling no hypothesis can produce — linked to the VC dimensions of thresholds (1), intervals (2), halfspaces in the plane (3) and axis-aligned rectangles (4).

How it works

  1. Pick a hypothesis class and place n points.
  2. Enumerate all labelings of the points with 0 / 1.
  3. For each labeling decide exactly whether some hypothesis produces it (thresholds: every 1 left of every 0; intervals: no 0 between the outer 1s; rectangles: no 0 in the bounding box of the 1s; halfspaces: strict linear separability).
  4. Draw a witness hypothesis for every realizable labeling.
  5. The set is shattered if every labeling is realized; VCdim is the size of the largest shattered set.

Default run (6 steps): 2 points and the class of intervals on a line (VC dimension 2). Check all 2^2 = 4 labelings: is each one produced by some hypothesis? … All 4 labelings are realized: intervals on a line shatter these 2 points, so VCdim >= 2. Theory: VCdim = 2, so no set of 3 points can be shattered.

Simplified: At most 6 points on a 0–10 board. The lab checks one placement at a time: failing to shatter one set of n points does not by itself show VCdim < n — that needs every placement (the lab states the known VC dimension).

Educational simulation

Loading the simulation…

Why Effective Size Matters

A hypothesis class can contain many hypotheses, but that total count does not always describe how expressive the class is on a particular set of examples. Uniform convergence studies this effective expressiveness by restricting the class to finite sets of instances and counting the different binary labelings that the hypotheses can produce there.

Key point

The central question is not only how many hypotheses exist, but how many distinct labelings they can induce on a finite sample.

Counting Induced Labelings

Take a set of m instances and restrict every hypothesis in the class to those instances. Each restricted hypothesis produces a binary labeling of the set. Some different hypotheses may produce the same labeling, so the relevant count is the number of distinct binary functions induced on that particular set.

Definition

The growth function, written as τH(m), is the largest number of distinct binary labelings that the hypothesis class H can induce on any set of m instances.

The word largest is essential. Different sets of m instances may allow different numbers of induced labelings. The growth function chooses the maximum count achievable over all sets of that size.

Set of m instancesSLabeling 1induced by HτH(m)maximum countLabeling 2induced by HLabeling kinduced by Hrestrict hypothesesrestrict hypothesesrestrict hypothesescount distinct labelingscount distinct labelingscount distinct labelings
Given a finite set of m examples, how does the growth function count the distinct binary labelings and then take the maximum over all sets of that size?

Shattering Every Pattern

A set of m instances is shattered by a hypothesis class when the class induces every possible binary labeling on that set. Since each of the m instances can receive either of two labels, there are 2^m possible binary labelings. Therefore, a shattered set has all 2^m labelings represented.

Worked example

A Shattered Three-Instance Set

Suppose a hypothesis class shatters a set containing three instances. How many distinct binary labelings must the class induce on that set?

  1. 1
    Count the instances

    The set contains m = 3 instances.

  2. 2
    Count all binary patterns

    Each instance has two possible labels, so the total number of binary labelings is 23.

  3. 3
    Use the definition of shattering

    Because the set is shattered, every one of those binary labelings is induced by some hypothesis in the class.

Result

The class induces all 8 possible binary labelings on the shattered set.

Three instances000001010011100101110111inducedinducedinducedinducedinducedinducedinducedinduced
What happens when a hypothesis class can realize every one of the 2^m possible binary labelings on a set of m examples?
Key point

Shattering gives the maximum possible count on a set of m instances: all 2m binary labelings occur.

The VC Dimension Threshold

Definition

The VC dimension of a hypothesis class is the size of its largest shattered set. If the VC dimension is d, then every number of examples m up to d is within the range where all 2^m labelings can be possible on a suitable shattered set.

This creates a threshold. Before the number of examples exceeds d, shattering can support exponential behavior: the growth function can reach 2^m. Once m is greater than d, the class cannot shatter an m-instance set. The growth function is then restricted to fewer than all possible binary labelings, and Sauer's Lemma gives a polynomially bounded upper bound.

m ≤ d2^m labelings possibleVC dimension dlargest shattered-set sizem > dSauer bound appliesreach largest shattered sizeexceed d
How does the size of the largest shattered set determine the transition point in the growth function?

Sauer's Polynomial Bound

Definition

Sauer's Lemma states that if VCdim(H) is at most d, then the growth function is bounded by the sum of the binomial coefficients from index 0 through d: τH(m) ≤ Σ from i = 0 to d of C(m, i).

The bound is especially useful when m exceeds d. The unrestricted number of binary labelings is 2m, which grows exponentially with m. Sauer's Lemma replaces that unrestricted upper bound with a sum whose highest index is fixed by the VC dimension. For a fixed d, this sum is polynomially bounded as m increases.

Worked example

Applying Sauer's Lemma

Assume VCdim(H) is at most 2 and consider m = 3 examples. What upper bound does Sauer's Lemma give?

  1. 1
    Substitute the VC dimension

    Use d = 2 in the sum of binomial coefficients.

  2. 2
    Substitute the sample size

    Use m = 3, giving C(3, 0) + C(3, 1) + C(3, 2).

  3. 3
    Evaluate the sum

    The terms are 1, 3, and 3, so the total is 7.

Result

τH(3) ≤ 7.

2^m all binary labelingsm > dτH(m)induced labelingsΣ C(m, i)0 ≤ i ≤ dhypothesis class may realize fewerbounded byactivates bound
How does Sauer's Lemma replace the exponential upper bound on labelings with a polynomial bound when the number of examples exceeds the VC dimension?

From Labelings to Uniform Convergence

Uniform convergence concerns controlling the difference between empirical error and true error for every hypothesis at once. The growth function helps with this analysis because it measures how many distinct behaviors the class can display on a finite sample. A class with fewer effective labelings has fewer distinct sample behaviors to control than its raw number of hypotheses might suggest.

The important chain of ideas is: restrict the class to a finite sample, count the distinct induced labelings, use the VC dimension to identify when full shattering stops, and apply Sauer's Lemma to obtain a polynomially bounded count after that point.

Hypothesis class HFinite sampleDistinct labelingsSauer boundUniform convergencerestrictcount induced behaviorapply VC dimensionsupport error control
How does limiting the number of distinct labelings on a finite sample help control the difference between empirical and true error for every hypothesis at once?

Common Counting Mistakes

  • Common mistake

    Counting hypotheses instead of distinct induced labelings.

    What it looks like

    Treating the full size of H as the growth function.

    Why it fails

    Different hypotheses can produce the same binary function on a particular finite set of instances.

    Do this instead

    Restrict the hypotheses to the set and count the distinct labelings they induce.

  • Common mistake

    Forgetting that the growth function takes a maximum over sets.

    What it looks like

    Counting labelings on one chosen set of m instances and calling that τH(m).

    Why it fails

    Different sets of m instances may permit different numbers of induced functions.

    Do this instead

    Use the largest count achievable over all sets of m instances.

  • Common mistake

    Assuming that a VC dimension of d means the growth function equals 2m for every m.

    What it looks like

    Extending the shattering count beyond m = d.

    Why it fails

    A VC dimension of d identifies the largest shattered-set size; after m exceeds d, full shattering is no longer available.

    Do this instead

    Use the exponential possibility up to the VC-dimension threshold and Sauer's Lemma for the larger-sample regime.

  • Common mistake

    Treating Sauer's upper bound as an exact count.

    What it looks like

    Concluding that τH(3) equals 7 whenever VCdim(H) is at most 2.

    Why it fails

    Sauer's Lemma gives an upper bound, not a claim that every set realizes that many labelings.

    Do this instead
    Write τH(3) ≤ 7 and interpret 7 as a ceiling.

Check Your Understanding

MEDIUM

A hypothesis class has VC dimension at most 2. For a set of 3 instances, answer the following: What is the largest possible number of binary labelings before applying Sauer's Lemma? What upper bound does Sauer's Lemma provide? Why are these two numbers different?

Hints
  • There are 2m possible binary labelings on m instances.
  • Use the terms in the Sauer sum from i = 0 through d.
  • The VC dimension prevents shattering once m exceeds d.

What do you think happens?

If a hypothesis class has VC dimension at most 2 and you examine 3 instances, which upper bound should you use for the growth function?

  • 2

  • 6

  • 7

  • 8

Reveal answer
Answer:

7

Sauer's Lemma gives τH(3) ≤ C(3, 0) + C(3, 1) + C(3, 2) = 1 + 3 + 3 = 7. The value 8 is the unrestricted count 2^3, but a class with VC dimension at most 2 cannot shatter a set of 3 instances.

Key Takeaways

  • The growth function τH(m) is the maximum number of distinct binary labelings that H can induce on any set of m instances.
  • A set is shattered when every one of its 2^m binary labelings is induced by the hypothesis class.
  • The VC dimension is the size of the largest shattered set and marks the transition point in the growth function.
  • Sauer's Lemma bounds the growth function by a sum of binomial coefficients when VCdim(H) is at most d.
  • After the number of examples exceeds the VC dimension, the effective number of labelings is polynomially bounded rather than freely exponential.

Related concepts

More concepts starting with U