Sponsored Links

Jumat, 19 Januari 2018

Sponsored Links

Sample Complexity and Uniform Convergence II - YouTube
src: i.ytimg.com

The sample complexity of a machine learning algorithm represents the number of training-samples that it needs in order to successfully learn a target function.

More precisely, the sample complexity is the number of training-samples that we need to supply to the algorithm, so that the function returned by the algorithm is within an arbitrarily small error of the best possible function, with probability arbitrarily close to 1.

There are two variants of sample complexity:

  • The weak variant fixes a particular input-output distribution;
  • The strong variant takes the worst-case sample complexity over all input-output distributions.

The No Free Lunch theorem, discussed below, proves that, in general, the strong sample complexity is infinite. I.e, there is no algorithm that can learn the globally-optimal target function using a finite number of training samples.

However, if we are only interested in a particular class of target functions (e.g, only linear functions) then the sample complexity is finite, and it depends linearly on the VC dimension on the class of target functions.


Video Sample complexity



Definition

Let X {\displaystyle X} be a space which we call the input space, and Y {\displaystyle Y} be a space which we call the output space, and let Z {\displaystyle Z} denote the product X × Y {\displaystyle X\times Y} . For example, in the setting of binary classification, X {\displaystyle X} is typically a finite-dimensional vector space and Y {\displaystyle Y} is the set { - 1 , 1 } {\displaystyle \{-1,1\}} .

Fix a hypothesis space H {\displaystyle {\mathcal {H}}} of functions h : X -> Y {\displaystyle h\colon X\to Y} . A learning algorithm over H {\displaystyle {\mathcal {H}}} is a computable map from Z * {\displaystyle Z^{*}} to H {\displaystyle {\mathcal {H}}} . In other words, it is an algorithm that takes as input a finite sequence of training samples and outputs a function from X {\displaystyle X} to Y {\displaystyle Y} . Typical learning algorithms include empirical risk minimization, without or with Tikhonov regularization.

Fix a loss function L o s s : Y × Y -> R >= 0 {\displaystyle Loss\colon Y\times Y\to \mathbb {R} _{\geq 0}} , for example, the square loss L o s s ( y , y ? ) = ( y - y ? ) 2 {\displaystyle Loss(y,y')=(y-y')^{2}} . For a given distribution ? {\displaystyle \rho } on X × Y {\displaystyle X\times Y} , the expected risk of a hypothesis (a function) h ? H {\displaystyle h\in {\mathcal {H}}} is

E ( h ) := E ? [ L o s s ( h ( x ) , y ) ] = ? X × Y L o s s ( h ( x ) , y ) d ? ( x , y ) {\displaystyle {\mathcal {E}}(h):=\mathbb {E} _{\rho }[Loss(h(x),y)]=\int _{X\times Y}Loss(h(x),y)\,d\rho (x,y)}

In our setting, we have h = A L G ( S n ) {\displaystyle h=ALG(S_{n})} where A L G {\displaystyle ALG} is a learning algorithm and S n = ( ( x 1 , y 1 ) , ... , ( x n , y n ) ) ~ ? n {\displaystyle S_{n}=((x_{1},y_{1}),\ldots ,(x_{n},y_{n}))\sim \rho ^{n}} is a sequence of vectors which are all drawn independently from ? {\displaystyle \rho } . Define the optimal risk

Set h n = A l g ( S n ) {\displaystyle h_{n}=Alg(S_{n})} for each n {\displaystyle n} . Note that h n {\displaystyle h_{n}} is a random variable and depends on the random variable S n {\displaystyle S_{n}} , which is drawn from the distribution ? n {\displaystyle \rho ^{n}} . The algorithm A L G {\displaystyle ALG} is called consistent if E ( h n ) {\displaystyle {\mathcal {E}}(h_{n})} probabilistically converges to E H * {\displaystyle {\mathcal {E}}_{\mathcal {H}}^{*}} , in other words, for all ?, ? > 0, there exists a positive integer N such that for all n >= N, we haveThe sample complexity of A L G {\displaystyle ALG} is then the minimum N for which this holds, as a function of ?, ?, and ?. We write the sample complexity as N ( ? , ? , ? ) {\displaystyle N(\rho ,\epsilon ,\delta )} to emphasize that this value of N depends on ?, ?, and ?. If A L G {\displaystyle ALG} is not consistent, then we set N ( ? , ? , ? ) = ? {\displaystyle N(\rho ,\epsilon ,\delta )=\infty } . If there exists an algorithm for which N ( ? , ? , ? ) {\displaystyle N(\rho ,\epsilon ,\delta )} is finite, then we say that the hypothesis space H {\displaystyle {\mathcal {H}}} is learnable.

In words, the sample complexity N ( ? , ? , ? ) {\displaystyle N(\rho ,\epsilon ,\delta )} defines the rate of consistency of the algorithm: given a desired accuracy ? and confidence ?, one needs to sample N ( ? , ? , ? ) {\displaystyle N(\rho ,\epsilon ,\delta )} data points to guarantee that the risk of the output function is within ? of the best possible, with probability at least 1 - ?.

In probabilistically approximately correct (PAC) learning, one is concerned with whether the sample complexity is polynomial, that is, whether N ( ? , ? , ? ) {\displaystyle N(\rho ,\epsilon ,\delta )} is bounded by a polynomial in 1/? and 1/?. If N ( ? , ? , ? ) {\displaystyle N(\rho ,\epsilon ,\delta )} is polynomial for some learning algorithm, then one says that the hypothesis space H {\displaystyle {\mathcal {H}}} is PAC-learnable. Note that this is a stronger notion than being learnable.


Maps Sample complexity



Unrestricted hypothesis space: infinite sample complexity

One can ask whether there exists a learning algorithm so that the sample complexity is finite in the strong sense, that is, there is a bound on the number of samples needed so that the algorithm can learn any distribution over the input-output space with a specified target error. More formally, one asks whether there exists a learning algorithm A L G {\displaystyle ALG} such that, for all ?, ? > 0, there exists a positive integer N such that for all n >= N, we have

where h n = A L G ( S n ) {\displaystyle h_{n}=ALG(S_{n})} , with S n = ( ( x 1 , y 1 ) , ... , ( x n , y n ) ) ~ ? n {\displaystyle S_{n}=((x_{1},y_{1}),\ldots ,(x_{n},y_{n}))\sim \rho ^{n}} as above. The No Free Lunch Theorem says that without restrictions on the hypothesis space H {\displaystyle {\mathcal {H}}} , this is not the case, i.e., there always exist "bad" distributions for which the sample complexity is arbitrarily large.

Thus, in order to make statements about the rate of convergence of the quantity

one must either
  • constrain the space of probability distributions ? {\displaystyle \rho } , e.g. via a parametric approach, or
  • constrain the space of hypotheses H {\displaystyle {\mathcal {H}}} , as in distribution-free approaches.

Computational Learning Theory - ppt video online download
src: slideplayer.com


Restricted hypothesis space: finite sample-complexity

The latter approach leads to concepts such as VC dimension and Rademacher complexity which control the complexity of the space H {\displaystyle {\mathcal {H}}} . A smaller hypothesis space introduces more bias into the inference process, meaning that E H * {\displaystyle {\mathcal {E}}_{\mathcal {H}}^{*}} may be greater than the best possible risk in a larger space. However, by restricting the complexity of the hypothesis space it becomes possible for an algorithm to produce more uniformly consistent functions. This trade-off leads to the concept of regularization.

It is a theorem from VC theory that the following three statements are equivalent for a hypothesis space H {\displaystyle {\mathcal {H}}} :

  1. H {\displaystyle {\mathcal {H}}} is PAC-learnable.
  2. The VC dimension of H {\displaystyle {\mathcal {H}}} is finite.
  3. H {\displaystyle {\mathcal {H}}} is a uniform Glivenko-Cantelli class.

This gives a way to prove that certain hypothesis spaces are PAC learnable, and by extension, learnable.

An example of a PAC-learnable hypothesis space

Let X = Rd, Y = {-1, 1}, and let H {\displaystyle {\mathcal {H}}} be the space of affine functions on X, that is, functions of the form x ? ? w , x ? + b {\displaystyle x\mapsto \langle w,x\rangle +b} for some w ? R d , b ? R {\displaystyle w\in \mathbb {R} ^{d},b\in \mathbb {R} } . This is the linear classification with offset learning problem. Now, note that four coplanar points in a square cannot be shattered by any affine function, since no affine function can be positive on two diagonally opposite vertices and negative on the remaining two. Thus, the VC dimension of H {\displaystyle {\mathcal {H}}} is d + 1 {\displaystyle d+1} , in particular finite. It follows by the above characterization of PAC-learnable classes that H {\displaystyle {\mathcal {H}}} is PAC-learnable, and by extension, learnable.

Sample-complexity bounds

Suppose H {\displaystyle {\mathcal {H}}} is a class of binary functions (functions to {0,1}). Then, H {\displaystyle {\mathcal {H}}} is ( ? , ? ) {\displaystyle (\epsilon ,\delta )} -PAC-learnable with a sample of size:

where V C ( H ) {\displaystyle VC({\mathcal {H}})} is the VC dimension of H {\displaystyle {\mathcal {H}}} . Moreover, any ( ? , ? ) {\displaystyle (\epsilon ,\delta )} -PAC-learning algorithm for H {\displaystyle {\mathcal {H}}} must have sample-complexity: Thus, the sample-complexity is a linear function of the VC dimension of the hypothesis space.

Suppose H {\displaystyle {\mathcal {H}}} is a class of real-valued functions with range in [0,T]. Then, H {\displaystyle {\mathcal {H}}} is ( ? , ? ) {\displaystyle (\epsilon ,\delta )} -PAC-learnable with a sample of size:

where P D ( H ) {\displaystyle PD({\mathcal {H}})} is Pollard's pseudo-dimension of H {\displaystyle {\mathcal {H}}} .
Ellen Vitercik on
src: i.ytimg.com


Other Settings

In addition to the supervised learning setting, sample complexity is relevant to semi-supervised learning problems including active learning, where the algorithm can ask for labels to specifically chosen inputs in order to reduce the cost of obtaining many labels. The concept of sample complexity also shows up in reinforcement learning, online learning, and unsupervised algorithms, e.g. for dictionary learning.


Computational Learning Theory - ppt video online download
src: slideplayer.com


References

Source of the article : Wikipedia

Comments
0 Comments