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.

Definition

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.

Fixed pointsx1, x2, ..., xnBinary labelingone assignmentBinary labelinganother assignmentClassifierone choice per labelingAll labelingsshatteredassignassignrealizerealizefor every assignment
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 Rd.

Classifier classBoundary constraintVC dimensionLower-bound set
Homogeneous halfspaces in RdBoundary passes through the origindd standard basis vectors
Non-homogeneous halfspaces in RdBias term is allowedd+1Zero vector plus d standard basis vectors

The source results for the two halfspace classes.

Homogeneous halfspacethrough originNon-homogeneoushalfspacebias allowedd pointsVC dimension dd+1 pointsVC dimension d+1shattersshatters
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 Rd 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.

Worked example

Labeling the Standard Basis

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

  1. 1
    Choose labels

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

  2. 2
    Build the weight vector

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

  3. 3
    Evaluate each basis vector

    The dot product of w with ei selects the i-th coordinate of w, so the result equals yi.

  4. 4
    Repeat for every labeling

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

Result

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

e1, e2, ..., edstandard basisy1, y2, ..., yddesired labelswcoordinates y1,...,ydAll labelingsd points shattereddot products select coordinatesset coordinatesrealize
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 Rd. 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.

d+1 vectorsin R^d Linear dependenceweighted sum is zeroPositive and negativegroupscoefficient signsIncompatible signsnot shatteredimpliesseparate coefficientsrestricts labeling
How does linear dependence restrict the labelings available to a homogeneous halfspace?
Definition

Combining the lower bound and upper bound gives the exact result: homogeneous halfspaces in Rd 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.

w with basis vectorsd controllable labelsw and biasbasis vectors plus zerod basis vectorsshatteredd+1 pointszero plus basisrealizes labelsrealizes labels
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 Rd could be shattered by non-homogeneous halfspaces, the situation could be converted into d+2 vectors in Rd+1 shattered by homogeneous halfspaces. But homogeneous halfspaces in Rd+1 have VC dimension d+1, so they cannot shatter d+2 vectors. Therefore, non-homogeneous halfspaces in Rd cannot shatter d+2 points.

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

The lower bound and upper bound together establish that non-homogeneous halfspaces in Rd 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 Rd.Reduce d+2 vectors in Rd to d+2 vectors in Rd+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

  • Common mistake

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

    What it looks like

    Showing that d points can be shattered and immediately declaring the VC dimension to be d.

    Why it fails

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

    Do this instead

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

  • Common mistake

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

    What it looks like

    Stopping with the d standard basis vectors when explaining why the non-homogeneous VC dimension is larger.

    Why it fails

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

    Do this instead

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

  • Common mistake

    Ignoring linear dependence in the homogeneous upper bound.

    What it looks like

    Claiming that d+1 vectors in R^d can receive arbitrary labels because the weight vector has many possible values.

    Why it fails

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

    Do this instead

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

  • Common mistake

    Confusing the original dimension with the augmented dimension.

    What it looks like

    Arguing that the non-homogeneous upper bound should be d because the original points lie in R^d.

    Why it fails

    The standard reduction converts the problem into homogeneous classification in Rd+1.

    Do this instead

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

At a glance

  • VC dimension is the largest number of points that a classifier class can shatter.
  • Homogeneous halfspaces in Rd 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 Rd 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 Rd+1.

Related concepts

More concepts starting with L