Docsity

Support vector machines (SVM) Notes, Lecture notes of Mathematics

Toggle sidebar
bg1
� �� �
�
�
Lecture 03 Support vector machines (SVM). 18.465
As in the previous lecture, consider the classification setting. Let X = Rd
, Y = {+1, −1}, and
H = {ψx + b, ψ ∈ Rd
, b ∈ R}
where |ψ| = 1.
We would like to maximize over the choice of hyperplanes the minimal distance from the data to the hyper-
plane:
max min d(xi,H ),
Hi
where
d(xi, H) = yi(ψxi + b).
Hence, the problem is formulated as maximizing the margin:
max min yi(ψxi + b) .
ψ,b i
m (margin)
Rewriting,
yi(ψxi + b)
yi(ψ�xi + b�) = ≥ 1,
m
ψ� = ψ/m, b� = b/m, |ψ�| = |ψ|/m = 1/m. Maximizing m is therefore minimizing |ψ�|. Rename ψ� → ψ, we
have the following formulation:
min |ψ| such that yi(ψxi + b) ≥ 1
Equivalently,
1
min 2 ψ · ψ such that yi(ψxi + b) ≥ 1
Introducing Lagrange multipliers:
1 �
φ =2 ψ · ψ − αi(yi(ψxi + b) − 1), αi ≥ 0
Take derivatives:
∂φ �
= ψ − αiyixi = 0
∂ψ
∂φ �
= − αiyi = 0
∂b
Hence,
ψ = αiyixi
and
αiyi = 0.
4
pf2

Partial preview of the text

Download Support vector machines (SVM) Notes and more Lecture notes Mathematics in PDF only on Docsity!

Lecture 03 Support vector machines (SVM). 18.

As in the previous lecture, consider the classification setting. Let X = R

d

, Y = {+1, − 1 }, and

H = {ψx + b, ψ ∈ R

d

, b ∈ R}

where |ψ| = 1.

We would like to maximize over the choice of hyperplanes the minimal distance from the data to the hyper

plane:

max min d(x i

, H),

H i

where

d(x i , H) = y i (ψx i

  • b).

Hence, the problem is formulated as maximizing the margin:

max min y i (ψx i

  • b).

ψ,b i

m (margin)

Rewriting,

y i

(ψx i

  • b)

y i (ψ

�

x i

  • b

�

) = ≥ 1 ,

m

ψ

�

= ψ/m, b

�

= b/m, |ψ

�

| = |ψ|/m = 1/m. Maximizing m is therefore minimizing |ψ

�

|. Rename ψ

�

→ ψ, we

have the following formulation:

min |ψ| such that y i (ψx i

  • b) ≥ 1

Equivalently,

min

ψ · ψ such that y i (ψx i

  • b) ≥ 1

Introducing Lagrange multipliers:

φ =

ψ · ψ − α i (y i (ψx i

  • b) − 1), α i

Take derivatives:

∂φ

= ψ − α i y i x i

∂ψ

∂φ

= − α i

y i

∂b

Hence,

ψ = α i

y i

x i

and

α i

y i

Lecture 03 Support vector machines (SVM). 18.

Substituting these into φ,

φ =

α i

y i

x i

2

n �

α i

y i

n �

α j

y j

x j

x i

  • b

i=1 j=

α i

α j

y i

y j

x i

x j

− α i

α j

y i

y j

x i

x j

− b α i

y i

  • α i

i,j i,j

= α i

α i

α j

y i

y j

x i

x j

The above expression has to be maximized this with respect to α i

, α i

≥ 0, which is a Quadratic Programming

problem.

Hence, we have ψ = i

n

=

α i

y i

x i

Kuhn-Tucker condition:

α i = 0� ⇔ y i (ψx i

  • b) − 1 = 0.

Throwing out non-support vectors x i

does not affect hyperplane α i

The mapping φ is a feature mapping:

x ∈ R

d

−→ φ(x) = (φ 1

(x), φ 2

(x), ...) ∈ X

�

where X

� is called feature space.

Support Vector Machines find optimal separating hyperplane in a very high-dimensional space. Let K(x i

, x j

∞

φ k

(x i

)φ k

(x j

) be a scalar product in X

�

. Notice that we don’t need to know mapping x → φ(x). We k=

only need to know K(x i

, x j

∞

k=

φ k

(x i

)φ k

(x j

), a symmetric positive definite kernel.

Examples:

(1) Polynomial: K(x 1

, x 2

) = (x 1

x 2

� , � ≥ 1.

(2) Radial Basis: K(x 1

, x 2

) = e

−γ|x 1 −x 2 |

2

(3) Neural (two-layer): K(x 1 , x 2

1+e

αx

1

1 x 2 +β

for some α, β (for some it’s not positive definite).

Once α i

are known, the decision function becomes

sign α i

y i

x x

· x + b = sign α i

y i

K(x i

, x) + b