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 function class can shatter—that is, for which all possible binary labelings can be realized by some function in the class. 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 that it can fit a given set of training points well. 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.
Let be a family of sets (also called set family, collection of sets, or set of sets) and be a set. Their intersection is defined as the following set family:
Here typically and each are subsets of a big "universe" of possibilities where intersection takes place.
We say that a set is shattered by if i.e. the set of intersections contains (hence is equal to the set of) all the subsets of . For finite sets this is equivalent to
The VC dimension of is the cardinality of the largest set that is shattered by . If arbitrarily large sets can be shattered, the VC dimension of is .
Consider a binary classification model with some parameter vector , a set of generally positioned data points . We say that the model shatters if, for every assignment of labels to those points, there exists a vector such that the model makes no errors when evaluating that set of data points[citation needed].
The VC dimension of a model is the maximum number of points that can be arranged so that shatters them. More formally, it is the maximum cardinal such that there exists a generally positioned data point set of cardinality that can be shattered by .
| 3 points shattered | 4 points impossible | ||
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:
where is the VC dimension of the classification model, , and is the size of the training set (restriction: this formula is valid when . When 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 can be learned with:: 73
samples, where is the learning error and 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.
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.
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.
Suppose we have a base class of simple classifiers, whose VC dimension is .
We can construct a more powerful classifier by combining several different classifiers from ; this technique is called boosting. Formally, given classifiers and a weight vector , we can define the following classifier:
The VC dimension of the set of all such classifiers (for all selections of classifiers from and a weight-vector from ), assuming , is at most:: 108–109
This section needs more citations. (May 2021) |
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:: 234–235
The VC dimension is defined for spaces of binary functions (functions to {0,1}). Several generalizations have been suggested for spaces of non-binary functions.