Concepts / Linear Classifiers in Binary Classification

Linear Classifiers in Binary Classification

VC dimension is a measure of classification capacity based on shattering.

  • Programming

Capacity Through Shattering

A binary classifier is more expressive when it can realize more different labelings of data points. VC dimension measures this capacity. It is the largest number of points that a classification class can shatter, where shattering means that every possible binary labeling of those points can be produced by some classifier in the class.

The VC dimension of a classification class is the largest number of points for which every possible binary labeling can be realized by some classifier in that class.

assignassignrealizerealizefor every assignmentFixed pointsx1, x2, ..., xnBinary labelingone assignmentBinary labelinganother assignmentClassifierone choice per labelingAll labelingsshattered
What must happen for a classifier class to shatter a fixed set of points?

Two Halfspace Classes

For halfspaces, the VC dimension depends on whether the separating boundary must pass through the origin. A homogeneous halfspace uses a weight vector and has no bias term. A non-homogeneous halfspace includes a bias term, so its boundary is not required to pass through the origin. The difference changes the largest number of points that can be shattered in R^d.

Classifier classBoundary constraintVC dimensionLower-bound set
Homogeneous halfspaces in R^dBoundary passes through the origindd standard basis vectors
Non-homogeneous halfspaces in R^dBias term is allowedd+1Zero vector plus d standard basis vectors
shattersshattersHomogeneous halfspacethrough originNon-homogeneoushalfspacebias allowedd pointsVC dimension dd+1 pointsVC dimension d+1
How does the boundary constraint affect the capacity of the classifier class?

Homogeneous Lower Bound

To prove that the VC dimension of homogeneous halfspaces in R^d is at least d, use the d standard basis vectors e1 through ed. Each basis vector has a 1 in one coordinate and 0 in every other coordinate.

Labeling the Standard Basis

Show how a weight vector can realize an arbitrary binary labeling of the d standard basis vectors.

Choose labels: Select any desired binary labels y1 through yd for the basis vectors e1 through ed.

Build the weight vector: Use those labels as the coordinates of the weight vector w.

Evaluate each basis vector: The dot product of w with ei selects the i-th coordinate of w, so the result equals yi.

Repeat for every labeling: Because the desired labels were arbitrary, the weight vector can realize every binary labeling of the d basis vectors.

The d standard basis vectors are shattered by homogeneous halfspaces, so the VC dimension is at least d.

dot products select coordinatesset coordinatesrealizee1, e2, ..., edstandard basisy1, y2, ..., yddesired labelswcoordinates y1,...,ydAll labelingsd points shattered
How can a homogeneous halfspace realize every labeling of d standard basis vectors?

Homogeneous Upper Bound

The lower bound alone is not enough. It shows that d points can be shattered, but an exact VC dimension also requires proving that d+1 points cannot be shattered.

Take any d+1 vectors in R^d. They are linearly dependent, so there are real coefficients a1 through a(d+1), not all zero, whose weighted combination of the vectors equals the zero vector. Separate the indices with positive coefficients from those with negative coefficients. If both groups are nonempty, shattering would require a weight vector whose dot products are positive on one group and negative on the other. Applying that weight vector to the dependence relation creates incompatible sign conditions. If one group is empty, the corresponding side becomes an equality, and the contradiction still follows.

impliesseparate coefficientsrestricts labelingd+1 vectorsin R^dLinear dependenceweighted sum is zeroPositive and negativegroupscoefficient signsIncompatible signsnot shattered
How does linear dependence restrict the labelings available to a homogeneous halfspace?

Combining the lower bound and upper bound gives the exact result: homogeneous halfspaces in R^d have VC dimension d.

The Bias Adds One Point

For non-homogeneous halfspaces, the lower-bound construction uses the zero vector together with the d standard basis vectors. This set contains d+1 points. The source proof states that this set is shattered by non-homogeneous halfspaces, paralleling the homogeneous construction for the basis vectors.

The distinction is the bias term. In the homogeneous construction, the weight vector supplies the coordinates used to control the labels of the standard basis vectors. In the non-homogeneous construction, the bias supplies the additional affine degree that makes it possible to include the zero vector as one more point in the shattered set.

realizes labelsrealizes labelsw with basis vectorsd controllable labelsw and biasbasis vectors plus zerod basis vectorsshatteredd+1 pointszero plus basis
What changes in the shattering construction when a bias term is added?

Augmented-Space Reduction

The non-homogeneous upper bound uses a standard reduction. If d+2 vectors in R^d could be shattered by non-homogeneous halfspaces, the situation could be converted into d+2 vectors in R^(d+1) shattered by homogeneous halfspaces. But homogeneous halfspaces in R^(d+1) have VC dimension d+1, so they cannot shatter d+2 vectors. Therefore, non-homogeneous halfspaces in R^d cannot shatter d+2 points.

convertrewriteapply VC dimension d+1Non-homogeneousclassifierR^dAugmentedrepresentationR^(d+1)HomogeneousclassifierR^(d+1)d+1 point limitcannot shatter d+2
How does the augmented-space reduction compare the non-homogeneous problem in R^d with a homogeneous problem in R^(d+1)?

The lower bound and upper bound together establish that non-homogeneous halfspaces in R^d have VC dimension d+1.

A Complete Proof Map

TaskHomogeneous halfspacesNon-homogeneous halfspaces
Lower boundShatter the d standard basis vectors.Shatter the zero vector together with the d standard basis vectors.
Upper boundUse linear dependence among any d+1 vectors in R^d.Reduce d+2 vectors in R^d to d+2 vectors in R^(d+1) and use the homogeneous result.
Exact VC dimensiondd+1

The lower- and upper-bound structure for both classifier classes.

The weight vector and bias should therefore be tracked separately. The weight vector is central to the homogeneous lower-bound construction because its coordinates are chosen to match the desired labels of the standard basis vectors. The bias changes the non-homogeneous class enough to support the additional zero vector in the lower-bound construction, and it is represented by the extra dimension in the upper-bound reduction.

Common Proof Mistakes

  • Treating a lower bound as the complete VC-dimension proof.

    Shattering d points proves only that the VC dimension is at least d. An upper bound is also required.

    Fix: Also show that no set of d+1 points can be shattered.

  • Using the homogeneous argument for the non-homogeneous class without modification.

    The non-homogeneous lower-bound construction includes the zero vector as well as the d standard basis vectors.

    Fix: Use the zero vector plus the d standard basis vectors for the lower bound.

  • Ignoring linear dependence in the homogeneous upper bound.

    Any d+1 vectors in R^d are linearly dependent, and the resulting sign constraints prevent at least one labeling from being realized.

    Fix: Use the dependence relation and separate its positive and negative coefficients.

  • Confusing the original dimension with the augmented dimension.

    The standard reduction converts the problem into homogeneous classification in R^(d+1).

    Fix: Apply the homogeneous VC-dimension result in the augmented space.

Apply the Proof Pattern

MEDIUM

Explain why the following two statements require different lower-bound constructions: homogeneous halfspaces in R^d have VC dimension d, while non-homogeneous halfspaces in R^d have VC dimension d+1. In your response, identify the point set used in each construction and state what the upper-bound argument must rule out.

Hints
  • For the homogeneous class, begin with the d standard basis vectors.
  • For the non-homogeneous class, identify the additional point.
  • For each exact result, distinguish the lower bound from the upper bound.

What do you think happens?

If a classifier class can shatter d points, is its VC dimension necessarily d?

  • Yes, because shattering d points defines the VC dimension.
  • No, an upper bound is also required.
  • Yes, if the points are standard basis vectors.
  • No, standard basis vectors cannot be shattered.
Reveal answer

Answer: No, an upper bound is also required.

A construction that shatters d points proves only a lower bound. The exact VC dimension requires a matching argument that no larger set can be shattered.

Key Takeaways

  1. VC dimension measures classification capacity through shattering.
  2. Homogeneous halfspaces in R^d shatter the d standard basis vectors.
  3. Linear dependence among any d+1 vectors in R^d prevents homogeneous halfspaces from shattering d+1 points.
  4. Non-homogeneous halfspaces can shatter the zero vector together with the d standard basis vectors.
  5. The augmented-space reduction gives the non-homogeneous upper bound, so its VC dimension is d+1.
  6. The weight vector controls the homogeneous basis-vector construction, while the bias enables the additional affine degree represented in the non-homogeneous argument.

Key Takeaways

  • VC dimension is the largest number of points that a classifier class can shatter.
  • Homogeneous halfspaces in R^d have VC dimension d.
  • The homogeneous lower bound uses the d standard basis vectors, while the upper bound uses linear dependence among d+1 vectors.
  • Non-homogeneous halfspaces in R^d have VC dimension d+1 because the bias supports one additional point in the lower-bound construction.
  • The non-homogeneous upper bound follows by converting the problem into homogeneous classification in R^(d+1).