Vapnik–Chervonenkis dimension explained

In Vapnik–Chervonenkis theory, the Vapnik–Chervonenkis (VC) dimension is a measure of the size (capacity, complexity, expressive power, richness, or flexibility) of a class of sets. The notion can be extended to classes of binary functions. It is defined as the cardinality of the largest set of points that the algorithm can shatter, which means the algorithm can always learn a perfect classifier for any labeling of at least one configuration of those data points. It was originally defined by Vladimir Vapnik and Alexey Chervonenkis.

Informally, the capacity of a classification model is related to how complicated it can be. For example, consider the thresholding of a high-degree polynomial: if the polynomial evaluates above zero, that point is classified as positive, otherwise as negative. A high-degree polynomial can be wiggly, so it can fit a given set of training points well. But one can expect that the classifier will make errors on other points, because it is too wiggly. Such a polynomial has a high capacity. A much simpler alternative is to threshold a linear function. This function may not fit the training set well, because it has a low capacity. This notion of capacity is made rigorous below.

Definitions

VC dimension of a set-family

Let

H

be a set family (a set of sets) and

C

a set. Their intersection is defined as the following set family:

H\capC:=\{h\capC\midh\inH\}.

We say that a set

C

is shattered by

H

if

H\capC

contains all the subsets of

C

, i.e.:

|H\capC|=2|C|.

The VC dimension

D

of

H

is the cardinality of the largest set that is shattered by

H

. If arbitrarily large sets can be shattered, the VC dimension is

infty

.

VC dimension of a classification model

A binary classification model

f

with some parameter vector

\theta

is said to shatter a set of generally positioned data points

(x1,x2,\ldots,xn)

if, for every assignment of labels to those points, there exists a

\theta

such that the model

f

makes no errors when evaluating that set of data points.

The VC dimension of a model

f

is the maximum number of points that can be arranged so that

f

shatters them. More formally, it is the maximum cardinal

D

such that there exists a generally positioned data point set of cardinality

D

that can be shattered by

f

.

Examples

f

is a constant classifier (with no parameters); Its VC dimension is 0 since it cannot shatter even a single point. In general, the VC dimension of a finite classification model, which can return at most

2d

different classifiers, is at most

d

(this is an upper bound on the VC dimension; the Sauer–Shelah lemma gives a lower bound on the dimension).

f

is a single-parametric threshold classifier on real numbers; i.e., for a certain threshold

\theta

, the classifier

f\theta

returns 1 if the input number is larger than

\theta

and 0 otherwise. The VC dimension of

f

is 1 because: (a) It can shatter a single point. For every point

x

, a classifier

f\theta

labels it as 0 if

\theta>x

and labels it as 1 if

\theta<x

. (b) It cannot shatter all the sets with two points. For every set of two numbers, if the smaller is labeled 1, then the larger must also be labeled 1, so not all labelings are possible.

f

is a single-parametric interval classifier on real numbers; i.e., for a certain parameter

\theta

, the classifier

f\theta

returns 1 if the input number is in the interval

[\theta,\theta+4]

and 0 otherwise. The VC dimension of

f

is 2 because: (a) It can shatter some sets of two points. E.g., for every set

\{x,x+2\}

, a classifier

f\theta

labels it as (0,0) if

\theta<x-4

or if

\theta>x+2

, as (1,0) if

\theta\in[x-4,x-2)

, as (1,1) if

\theta\in[x-2,x]

, and as (0,1) if

\theta\in(x,x+2]

. (b) It cannot shatter any set of three points. For every set of three numbers, if the smallest and the largest are labeled 1, then the middle one must also be labeled 1, so not all labelings are possible.

f

is a straight line as a classification model on points in a two-dimensional plane (this is the model used by a perceptron). The line should separate positive data points from negative data points. There exist sets of 3 points that can indeed be shattered using this model (any 3 points that are not collinear can be shattered). However, no set of 4 points can be shattered: by Radon's theorem, any four points can be partitioned into two subsets with intersecting convex hulls, so it is not possible to separate one of these two subsets from the other. Thus, the VC dimension of this particular classifier is 3. It is important to remember that while one can choose any arrangement of points, the arrangement of those points cannot change when attempting to shatter for some label assignment. Note, only 3 of the 23 = 8 possible label assignments are shown for the three points.

f

is a single-parametric sine classifier, i.e., for a certain parameter

\theta

, the classifier

f\theta

returns 1 if the input number

x

has

\sin(\thetax)>0

and 0 otherwise. The VC dimension of

f

is infinite, since it can shatter any finite subset of the set

\{2-m\midm\inN\}

.

Uses

In statistical learning theory

The VC dimension can predict a probabilistic upper bound on the test error of a classification model. Vapnik proved that the probability of the test error (i.e., risk with 0–1 loss function) distancing from an upper bound (on data that is drawn i.i.d. from the same distribution as the training set) is given by:

\Pr\left(testerror\leqslanttrainingerror+\sqrt{

1
N

\left[D\left(log\left(\tfrac{2N}{D}\right)+1\right)-log\left(\tfrac{η}{4}\right)\right]}\right)=1-η,

where

D

is the VC dimension of the classification model,

0<η\leqslant1

, and

N

is the size of the training set (restriction: this formula is valid when

D\llN

. When

D

is larger, the test-error may be much higher than the training-error. This is due to overfitting).

The VC dimension also appears in sample-complexity bounds. A space of binary functions with VC dimension

D

can be learned with:

N=\Theta\left(

D+ln{1\over\delta
}\right)

samples, where

\varepsilon

is the learning error and

\delta

is the failure probability. Thus, the sample-complexity is a linear function of the VC dimension of the hypothesis space.

The VC dimension is one of the critical parameters in the size of ε-nets, which determines the complexity of approximation algorithms based on them; range sets without finite VC dimension may not have finite ε-nets at all.

Bounds

  1. The VC dimension of the dual set-family of

lF

is strictly less than

2\operatorname{vc(lF)+1}

, and this is best possible.
  1. The VC dimension of a finite set-family

H

is at most

log2|H|

. This is because

|H\capC|\leq|H|

by definition.
  1. Given a set-family

H

, define

Hs

as a set-family that contains all intersections of

s

elements of

H

. Then: \operatorname(H_s) \leq \operatorname(H)\cdot (2 s \log_2(3s))
  1. Given a set-family

H

and an element

h0\inH

, define

H\Deltah0:=\{h\Deltah0\midh\inH\}

where

\Delta

denotes symmetric set difference. Then: \operatorname(H\,\Delta h_0) = \operatorname(H)

Examples of VC Classes

VC dimension of a finite projective plane

A finite projective plane of order n is a collection of n2 + n + 1 sets (called "lines") over n2 + n + 1 elements (called "points"), for which:

The VC dimension of a finite projective plane is 2.[1]

Proof: (a) For each pair of distinct points, there is one line that contains both of them, lines that contain only one of them, and lines that contain none of them, so every set of size 2 is shattered. (b) For any triple of three distinct points, if there is a line x that contain all three, then there is no line y that contains exactly two (since then x and y would intersect in two points, which is contrary to the definition of a projective plane). Hence, no set of size 3 is shattered.

VC dimension of a boosting classifier

Suppose we have a base class

B

of simple classifiers, whose VC dimension is

D

.

We can construct a more powerful classifier by combining several different classifiers from

B

; this technique is called boosting. Formally, given

T

classifiers

h1,\ldots,hT\inB

and a weight vector

w\inRT

, we can define the following classifier:

f(x)=\operatorname{sign}\left(

T
\sum
t=1

wtht(x)\right)

The VC dimension of the set of all such classifiers (for all selections of

T

classifiers from

B

and a weight-vector from

RT

), assuming

T,D\ge3

, is at most:

T(D+1)(3log(T(D+1))+2)

VC dimension of a neural network

A neural network is described by a directed acyclic graph G(V,E), where:

The VC dimension of a neural network is bounded as follows:

O(|E|log(|E|))

.

\Omega(|E|2)

and at most

O(|E|2 ⋅ |V|2)

.

O(|E|)

.

Generalizations

The VC dimension is defined for spaces of binary functions (functions to). Several generalizations have been suggested for spaces of non-binary functions.

See also

References

Notes and References

  1. Book: 10.1145/41958.41994. Partitioning and geometric embedding of range spaces of finite Vapnik-Chervonenkis dimension. Proceedings of the third annual symposium on Computational geometry – SCG '87. 331. 1987. Alon. N.. Haussler. D.. Welzl. E.. 978-0897912310. 7394360.