advanced29 min studyLesson 753 in Mathematics

VC dimension and growth functions

Measure binary class capacity through realizable label patterns rather than parameter count.

On this page

What you’ll understand

  • Compute shattering and growth functions on ordered samples.
  • Apply the Sauer–Shelah bound with its finite-dimension conditions.
  • Distinguish a combinatorial capacity count from a complete measurable generalization theorem.

An infinite class can produce only a small number of distinct labelings on a finite sample. VC theory counts these patterns instead of counting the class members themselves. The count captures an important source of adaptivity in binary classification, but it is not simply the number of real parameters. A concrete interval class makes the definitions and the limits of a naive counting argument visible.

Shattering is about every labeling of one set

A set of d distinct inputs is shattered if the class realizes all 2d2^d binary labelings on that same set. VC dimension is the largest such d, or infinity when arbitrarily large finite sets can be shattered. Showing that a class realizes many patterns on different input sets is insufficient: all patterns must be available on one chosen set. The growth function takes the maximum number of restrictions the class can realize on any n distinct inputs, and is at most 2n2^n. This displayed distinct-point form assumes the domain has at least n points; for a smaller finite domain use n-tuples allowing repeated inputs.

Consider classifiers that label a real input positive exactly when it belongs to one interval, allowing an empty positive set. Two ordered points are shattered: an interval can select neither, either singleton, or both. Three ordered points are not shattered, because selecting the two extremes without the middle is impossible for an interval. Hence the class has VC dimension two. The argument uses the order structure of the inputs, not an assertion that two endpoints always imply two units of capacity in arbitrary parameterizations.

ΠH(n)=max⁡x1,…,xn distinct∣{(h(x1),…,h(xn)):h∈H}∣,VC⁡(H)=sup⁡{d:ΠH(d)=2d}\Pi_H(n)=\max_{x_1,\ldots,x_n\ \mathrm{distinct}}\left|\{(h(x_1),\ldots,h(x_n)):h\in H\}\right|,\qquad \operatorname{VC}(H)=\sup\{d:\Pi_H(d)=2^d\}
For binary classes, the growth function counts distinct label vectors on a common input set; infinite VC dimension is permitted.↔ Scroll wide equations horizontally.

Count interval patterns and compare the general bound

On n ordered distinct real points, a nonempty interval-positive labeling is exactly one contiguous positive block. Choose the first and last positive points to obtain n(n+1)/2 possibilities, and add the all-negative labeling. Many different endpoint pairs represent the same pattern because endpoints can move between sample points. That redundancy is precisely why the infinite parameter space need not prevent finite-sample control. The all-positive labeling is already one of the contiguous blocks and must not be counted twice.

The Sauer–Shelah lemma says that a binary class with finite VC dimension d has growth at most the sum of binomial coefficients through d. When n≥d≥1, this sum is at most (en/d)d(en/d)^d. If d=0 the appropriate bound is one, and if n<d the trivial 2n2^n bound is the useful form. The lemma is a combinatorial theorem and makes no sampling claim by itself. For interval classifiers the d=2 binomial sum equals the exact contiguous-block count; the simpler exponential bound is generally looser.

ΠH(n)≤∑j=0d(nj)≤(end)d(n≥d≥1),Πintervals(n)=1+n(n+1)2\Pi_H(n)\le\sum_{j=0}^{d}\binom nj\le\left(\frac{en}{d}\right)^d\quad(n\ge d\ge1),\qquad \Pi_{\mathrm{intervals}}(n)=1+\frac{n(n+1)}2
The final exact formula includes the empty interval pattern; the preceding bound applies to any binary class of VC dimension d.↔ Scroll wide equations horizontally.

Turn pattern counting into learning carefully

A tempting but incomplete argument unions over the label patterns observed on the training sample as though that random set of patterns were fixed in advance. VC generalization proofs introduce an independent ghost sample or symmetrization so that the relevant finite restrictions can be counted legitimately. Under standard measurability assumptions, finite VC dimension gives distribution-free binary PAC learnability. The usual elementary agnostic bounds scale like the square root of a dimension-and-confidence term divided by sample size, possibly with a logarithmic sample-size factor depending on the proof.

For rigorous probability statements here, one may restrict to finite or countable classes, or assume the appropriate suprema and selection rules are measurable. A raw VC count alone does not settle pathological measurability cases or computational efficiency. Nor does a small parameter count prove low VC dimension without examining the function family. Practical use begins by identifying the actual decision class, proving its shattering dimension, and checking that the learning algorithm and data model match the theorem whose rate is being invoked.

Intervals on five inputs

For positive-on-an-interval classifiers on five distinct ordered real inputs, count realizable labelings, compare with all binary labelings and with the d=2 Sauer bound.

  1. A nonempty positive block has a first and last index. The number of such index pairs is 5·6/2=15, including the block containing every point.

  2. Add the all-negative labeling to obtain 16 patterns. There are 2⁵=32 possible binary labelings, so intervals realize exactly half of them.

  3. With d=2, Sauer gives (50)+(51)+(52)=1+5+10=16\binom50+\binom51+\binom52=1+5+10=16. For this interval class the binomial sum in fact matches the contiguous-block formula at every n; the simpler exponential relaxation need not be exact.

The result

There are 16 interval patterns out of 32 binary patterns, and the Sauer sum is also 16 in this particular case.

Explore the model

Interactive lab

Interactive lab · probability

All patterns versus a count statistic

Pause and Reset, then set p = 0.50 and n = 5. Each of the 32 fair binary strings has probability 1/32, while the lab merges strings with the same number of positives. Predict the bar for two positives is 10/32. Only some of those strings are contiguous interval blocks; the bar cannot identify which. Reset and set both p = 0.50 and n = 3 to compare the eight-string sample space.

All patterns versus a count statisticThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA binomial count collapses positional patterns, while VC dimension depends on which full labelings the class realizes.

Check your understanding

Why do interval classifiers fail to shatter three ordered real inputs?

Try it yourself

Count interval patterns on four ordered distinct inputs. Compare the exact number with the d=2 Sauer sum, and explain why neither equals the total number of endpoint pairs.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Count nonempty contiguous blocks, then add one empty pattern. For Sauer, add the first three binomial coefficients.

Compare with the solution

The exact interval count is 1+4⋅5/2=111+4\cdot5/2=11. The Sauer sum is 1+4+6=111+4+6=11 as well. There are sixteen unrestricted binary labelings, so five are unavailable to intervals. Endpoint pairs form an infinite set, but shifting an endpoint without crossing a sample input leaves the label vector unchanged; many pairs therefore represent one restriction. This count concerns four distinct inputs and positive-on-one-interval classifiers with an empty pattern permitted. A union of several intervals would be a different class and could realize patterns missing here.

Take it with you

  • Shattering requires all binary patterns on the same input set.
  • Growth counts restrictions rather than parameter descriptions.
  • Sauer–Shelah is combinatorial; probability bounds need symmetrization and measurable learning assumptions.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.