# 2.3 Machine learning lecture 4 course notes  (Page 5/5)

 Page 5 / 5

Let's put all this together into a theorem.

Theorem. Let $|\mathcal{H}|=k$ , and let any $m,\delta$ be fixed. Then with probability at least $1-\delta$ , we have that

$\epsilon \left(\stackrel{^}{h}\right)\le \left(\underset{h\in \mathcal{H}}{min},\epsilon ,\left(h\right)\right)+2\sqrt{\frac{1}{2m}log\frac{2k}{\delta }}.$

This is proved by letting $\gamma$ equal the $\sqrt{·}$ term, using our previous argument that uniform convergence occurs with probability at least $1-\delta$ , and then noting that uniform convergence implies $\epsilon \left(h\right)$ is at most $2\gamma$ higher than $\epsilon \left({h}^{*}\right)={min}_{h\in \mathcal{H}}\epsilon \left(h\right)$ (as we showed previously).

This also quantifies what we were saying previously saying about the bias/variance tradeoff in model selection. Specifically, suppose we have some hypothesis class $\mathcal{H}$ , and are considering switching to some much larger hypothesis class ${\mathcal{H}}^{\text{'}}\supseteq \mathcal{H}$ . If we switch to ${\mathcal{H}}^{\text{'}}$ , then the first term ${min}_{h}\epsilon \left(h\right)$ can only decrease (since we'd then be taking a min over a larger set of functions). Hence,by learning using a larger hypothesis class, our “bias” can only decrease. However, if k increases, then the second $2\sqrt{·}$ term would also increase. This increase corresponds to our “variance” increasingwhen we use a larger hypothesis class.

By holding $\gamma$ and $\delta$ fixed and solving for $m$ like we did before, we can also obtain the following sample complexity bound:

Corollary. Let $|\mathcal{H}|=k$ , and let any $\delta ,\gamma$ be fixed. Then for $\epsilon \left(\stackrel{^}{h}\right)\le {min}_{h\in \mathcal{H}}\epsilon \left(h\right)+2\gamma$ to hold with probability at least $1-\delta$ , it suffices that

$\begin{array}{ccc}\hfill m& \ge & \frac{1}{2{\gamma }^{2}}log\frac{2k}{\delta }\hfill \\ & =& O\left(\frac{1}{{\gamma }^{2}},log,\frac{k}{\delta }\right),\hfill \end{array}$

## The case of infinite $\mathcal{H}$

We have proved some useful theorems for the case of finite hypothesis classes. But many hypothesis classes, including any parameterized by real numbers(as in linear classification) actually contain an infinite number of functions. Can we prove similar results for this setting?

Let's start by going through something that is not the “right” argument. Better and more general arguments exist , but this will be useful for honing our intuitions about the domain.

Suppose we have an $\mathcal{H}$ that is parameterized by $d$ real numbers. Since we are using a computer to represent real numbers, and IEEE double-precision floating point ( double 's in C) uses 64 bitsto represent a floating point number, this means that our learning algorithm, assuming we're using double-precision floating point, is parameterized by $64d$ bits. Thus, our hypothesis class really consists of at most $k={2}^{64d}$ different hypotheses. From the Corollary at the end of the previous section, we therefore find that, to guarantee $\epsilon \left(\stackrel{^}{h}\right)\le \epsilon \left({h}^{*}\right)+2\gamma$ , with to hold with probability at least $1-\delta$ , it suffices that $m\ge O\left(\frac{1}{{\gamma }^{2}},log,\frac{{2}^{64d}}{\delta }\right)=O\left(\frac{d}{{\gamma }^{2}},log,\frac{1}{\delta }\right)={O}_{\gamma ,\delta }\left(d\right)$ . (The $\gamma ,\delta$ subscripts are to indicate that the last big- $O$ is hiding constants that may depend on $\gamma$ and $\delta$ .) Thus, the number of training examples needed is at most linear in the parameters of the model.

The fact that we relied on 64-bit floating point makes this argument not entirely satisfying, but the conclusion is nonetheless roughly correct: If what we're going to do is try to minimize training error,then in order to learn “well” using a hypothesis class that has $d$ parameters, generally we're going to need on the order of a linear number of training examples in $d$ .

(At this point, it's worth noting that these results were proved for an algorithm that uses empirical risk minimization. Thus, while the linear dependence of samplecomplexity on $d$ does generally hold for most discriminative learning algorithms that try to minimize trainingerror or some approximation to training error, these conclusions do not always apply as readily to discriminative learning algorithms. Giving good theoreticalguarantees on many non-ERM learning algorithms is still an area of active research.)

The other part of our previous argument that's slightly unsatisfying is that it relies on the parameterization of $\mathcal{H}$ . Intuitively, this doesn't seem like it should matter: We had written the classof linear classifiers as ${h}_{\theta }\left(x\right)=1\left\{{\theta }_{0}+{\theta }_{1}{x}_{1}+\cdots {\theta }_{n}{x}_{n}\ge 0\right\}$ , with $n+1$ parameters ${\theta }_{0},...,{\theta }_{n}$ . But it could also be written ${h}_{u,v}\left(x\right)=1\left\{\left({u}_{0}^{2}-{v}_{0}^{2}\right)+\left({u}_{1}^{2}-{v}_{1}^{2}\right){x}_{1}+\cdots \left({u}_{n}^{2}-{v}_{n}^{2}\right){x}_{n}\ge 0\right\}$ with $2n+2$ parameters ${u}_{i},{v}_{i}$ . Yet, both of these are just defining the same $\mathcal{H}$ : The set of linear classifiers in $n$ dimensions.

To derive a more satisfying argument, let's define a few more things.

Given a set $S=\left\{{x}^{\left(i\right)},...,{x}^{\left(d\right)}\right\}$ (no relation to the training set) of points ${x}^{\left(i\right)}\in \mathcal{X}$ , we say that $\mathcal{H}$ shatters $S$ if $\mathcal{H}$ can realize any labeling on $S$ . I.e., if for any set of labels $\left\{{y}^{\left(1\right)},...,{y}^{\left(d\right)}\right\}$ , there existssome $h\in \mathcal{H}$ so that $h\left({x}^{\left(i\right)}\right)={y}^{\left(i\right)}$ for all $i=1,...d$ .

Given a hypothesis class $\mathcal{H}$ , we then define its Vapnik-Chervonenkis dimension , written $\mathrm{VC}\left(\mathcal{H}\right)$ , to be the size of the largest set that is shattered by $\mathcal{H}$ . (If $\mathcal{H}$ can shatter arbitrarily large sets, then $\mathrm{VC}\left(\mathcal{H}\right)=\infty$ .)

For instance, consider the following set of three points:

Can the set $\mathcal{H}$ of linear classifiers in two dimensions ( $h\left(x\right)=1\left\{{\theta }_{0}+{\theta }_{1}{x}_{1}+{\theta }_{2}{x}_{2}\ge 0\right\}$ ) can shatter the set above? The answer is yes. Specifically, we see that, for any of the eight possiblelabelings of these points, we can find a linear classifier that obtains “zero training error” on them:

Moreover, it is possible to show that there is no set of 4 points that this hypothesis class can shatter. Thus, the largest set that $\mathcal{H}$ can shatter is of size 3, and hence $\mathrm{VC}\left(\mathcal{H}\right)=3$ .

Note that the VC dimension of $\mathcal{H}$ here is 3 even though there may be sets of size 3 that it cannot shatter. For instance, if we had a set of three pointslying in a straight line (left figure), then there is no way to find a linear separator for the labeling of the three points shown below (right figure):

In order words, under the definition of the VC dimension, in order to prove that $\mathrm{VC}\left(\mathcal{H}\right)$ is at least $d$ , we need to show only that there's at least one set of size $d$ that $\mathcal{H}$ can shatter.

The following theorem, due to Vapnik, can then be shown. (This is, many would argue, the most important theorem in all of learning theory.)

Theorem. Let $\mathcal{H}$ be given, and let $d=\mathrm{VC}\left(\mathcal{H}\right)$ . Then with probability at least $1-\delta$ , we have that for all $h\in \mathcal{H}$ ,

$|\epsilon \left(h\right)-\stackrel{^}{\epsilon }\left(h\right)|\le O\left(\sqrt{\frac{d}{m}log\frac{m}{d}+\frac{1}{m}log\frac{1}{\delta }}\right).$

Thus, with probability at least $1-\delta$ , we also have that:

$\epsilon \left(\stackrel{^}{h}\right)\le \epsilon \left({h}^{*}\right)+O\left(\sqrt{\frac{d}{m}log\frac{m}{d}+\frac{1}{m}log\frac{1}{\delta }}\right).$

In other words, if a hypothesis class has finite VC dimension, then uniform convergence occurs as $m$ becomes large. As before,this allows us to give a bound on $\epsilon \left(h\right)$ in terms of $\epsilon \left({h}^{*}\right)$ . We also have the following corollary:

Corollary. For $|\epsilon \left(h\right)-\stackrel{^}{\epsilon }\left(h\right)|\le \gamma$ to hold for all $h\in \mathcal{H}$ (and hence $\epsilon \left(\stackrel{^}{h}\right)\le \epsilon \left({h}^{*}\right)+2\gamma$ ) with probability at least $1-\delta$ , it suffices that $m={O}_{\gamma ,\delta }\left(d\right)$ .

In other words, the number of training examples needed to learn “well” using $\mathcal{H}$ is linear in the VC dimension of $\mathcal{H}$ . It turns out that, for “most” hypothesis classes, the VC dimension (assuming a “reasonable” parameterization) is also roughly linear in the number of parameters.Putting these together, we conclude that (for an algorithm that tries to minimize training error) the number of trainingexamples needed is usually roughly linear in the number of parameters of $\mathcal{H}$ .

where we get a research paper on Nano chemistry....?
what are the products of Nano chemistry?
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
hey
Giriraj
Preparation and Applications of Nanomaterial for Drug Delivery
revolt
da
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!