# 2.2 Machine learning lecture 3 course notes  (Page 2/12)

 Page 2 / 12

## Notation

To make our discussion of SVMs easier, we'll first need to introduce a new notation for talking about classification.We will be considering a linear classifier for a binary classification problem with labels $y$ and features $x$ . From now, we'll use $y\in \left\{-1,1\right\}$ (instead of $\left\{0,1\right\}$ ) to denote the class labels. Also, rather than parameterizing our linearclassifier with the vector $\theta$ , we will use parameters $w,b$ , and write our classifier as

${h}_{w,b}\left(x\right)=g\left({w}^{T}x+b\right).$

Here, $g\left(z\right)=1$ if $z\ge 0$ , and $g\left(z\right)=-1$ otherwise. This “ $w,b$ ” notation allows us to explicitly treat the intercept term $b$ separately from the other parameters. (We also drop the convention we had previously of letting ${x}_{0}=1$ be an extra coordinate in the input feature vector.) Thus, $b$ takes the role of what was previously ${\theta }_{0}$ , and $w$ takes the role of ${\left[{\theta }_{1}...{\theta }_{n}\right]}^{T}$ .

Note also that, from our definition of $g$ above, our classifier will directly predict either 1 or $-1$ (cf. the perceptron algorithm), without first going through the intermediate step of estimating the probability of $y$ being 1 (which was what logistic regression did).

## Functional and geometric margins

Let's formalize the notions of the functional and geometric margins. Given a training example $\left({x}^{\left(i\right)},{y}^{\left(i\right)}\right)$ , we define the functional margin of $\left(w,b\right)$ with respect to the training example

$\stackrel{^}{\gamma }{}^{\left(i\right)}={y}^{\left(i\right)}\left({w}^{T}x+b\right).$

Note that if ${y}^{\left(i\right)}=1$ , then for the functional margin to be large (i.e., for our prediction to be confident and correct), we need ${w}^{T}x+b$ to be a large positive number. Conversely, if ${y}^{\left(i\right)}=-1$ , then for the functional margin to be large, we need ${w}^{T}x+b$ to be a large negative number. Moreover, if ${y}^{\left(i\right)}\left({w}^{T}x+b\right)>0$ , then our prediction on this example is correct. (Check this yourself.)Hence, a large functional margin represents a confident and a correct prediction.

For a linear classifier with the choice of $g$ given above (taking values in $\left\{-1,1\right\}$ ), there's one property of the functional margin that makes it not a very good measure of confidence,however. Given our choice of $g$ , we note that if we replace $w$ with $2w$ and $b$ with $2b$ , then since $g\left({w}^{T}x+b\right)=g\left(2{w}^{T}x+2b\right)$ , this would not change ${h}_{w,b}\left(x\right)$ at all. I.e., $g$ , and hence also ${h}_{w,b}\left(x\right)$ , depends only on the sign, but not on the magnitude, of ${w}^{T}x+b$ . However, replacing $\left(w,b\right)$ with $\left(2w,2b\right)$ also results in multiplying our functional margin by a factor of 2. Thus, it seems that by exploiting our freedom to scale $w$ and $b$ , we can make the functional margin arbitrarily large without really changing anything meaningful. Intuitively, it might therefore make senseto impose some sort of normalization condition such as that ${||w||}_{2}=1$ ; i.e., we might replace $\left(w,b\right)$ with $\left(w/||w|{|}_{2},b/||w|{|}_{2}\right)$ , and instead consider the functional margin of $\left(w/||w|{|}_{2},b/||w|{|}_{2}\right)$ . We'll come back to this later.

Given a training set $S=\left\{\left({x}^{\left(i\right)},{y}^{\left(i\right)}\right);i=1,...,m\right\}$ , we also define the function margin of $\left(w,b\right)$ with respect to $S$ to be the smallest of the functional margins of the individual training examples. Denotedby $\stackrel{^}{\gamma }$ , this can therefore be written:

$\stackrel{^}{\gamma }=\underset{i=1,...,m}{min}\stackrel{^}{\gamma }{}^{\left(i\right)}.$

Next, let's talk about geometric margins . Consider the picture below:

The decision boundary corresponding to $\left(w,b\right)$ is shown, along with the vector $w$ . Note that $w$ is orthogonal (at ${90}^{\circ }$ ) to the separating hyperplane. (You should convince yourself that this must be the case.) Consider the point at A, which represents the input ${x}^{\left(i\right)}$ of some training example with label ${y}^{\left(i\right)}=1$ . Its distance to the decision boundary, ${\gamma }^{\left(i\right)}$ , is given by the line segment AB.

are nano particles real
yeah
Joseph
Hello, if I study Physics teacher in bachelor, can I study Nanotechnology in master?
no can't
Lohitha
where we get a research paper on Nano chemistry....?
nanopartical of organic/inorganic / physical chemistry , pdf / thesis / review
Ali
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
has a lot of application modern world
Kamaluddeen
yes
narayan
what is variations in raman spectra for nanomaterials
ya I also want to know the raman spectra
Bhagvanji
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
Got questions? Join the online conversation and get instant answers!