Inmathematics, acovering number is the number ofballs of a given size needed to completely cover a given space, with possible overlaps between the balls. The covering number quantifies the size of a set and can be applied to generalmetric spaces. Two related concepts are thepacking number, the number of disjoint balls that fit in a space, and themetric entropy, the number of points that fit in a space when constrained to lie at some fixed minimum distance apart.
Let (M,d) be ametric space, letK be a subset ofM, and letr be a positivereal number. LetBr(x) denote the closedball of radiusr centered atx. A subsetC ofM is anr-external covering ofK if:
.
In other words, for every
there exists
such that
.
If furthermoreC is a subset ofK, then it is anr-internal covering.
Theexternal covering number ofK, denoted
, is the minimumcardinality of any external covering ofK. Theinternal covering number, denoted
, is the minimum cardinality of any internal covering.
A subsetP ofK is apacking if
and the set
ispairwise disjoint. Thepacking number ofK, denoted
, is the maximum cardinality of any packing ofK.
A subsetS ofK isr-separated if each pair of pointsx andy inS satisfiesd(x,y) ≥r. Themetric entropy ofK, denoted
, is the maximum cardinality of anyr-separated subset ofK.
- The metric space is the real line
.
is a set of real numbers whose absolute value is at most
. Then, there is an external covering of
intervals of length
, covering the interval
. Hence:
- The metric space is theEuclidean space
with theEuclidean metric.
is a set of vectors whose length (norm) is at most
. If
lies in ad-dimensional subspace of
, then:[1]: 337
. - The metric space is the space of real-valued functions, with theℓ-infinity metric. The covering number
is the smallest number
such that there exist
such that, for all
there exists
such that the supremum distance between
and
is at most
. The above bound is not relevant since the space is
-dimensional. However, when
is acompact set, every covering of it has a finite sub-covering, so
is finite.[2]: 61
The following properties relate to covering numbers in the standardEuclidean space,
:[1]: 338
Application to machine learning
[edit]Let
be a space of real-valued functions, with theℓ-infinity metric (see example 3 above).Suppose all functions in
are bounded by a real constant
.Then, the covering number can be used to bound thegeneralization errorof learning functions from
,relative to the squared loss:[2]: 61
![{\displaystyle \operatorname {Prob} \left[\sup _{h\in K}{\big \vert }{\text{GeneralizationError}}(h)-{\text{EmpiricalError}}(h){\big \vert }\geq \epsilon \right]\leq N_{r}^{\text{int}}(K)\,2\exp {-m\epsilon ^{2} \over 2M^{4}}}](/image.pl?url=https%3a%2f%2fwikimedia.org%2fapi%2frest_v1%2fmedia%2fmath%2frender%2fsvg%2f820ca590deb26321d7203386626ebb67fde35a11&f=jpg&w=240)
where
and
is the number of samples.