Docsity

Support Vector Machines: CS446-Spring08 Lecture Notes - Prof. Dan Roth, Study notes of Computer Science

Partial preview of the text

Download Support Vector Machines: CS446-Spring08 Lecture Notes - Prof. Dan Roth and more Study notes Computer Science in PDF only on Docsity!

CS446-Spring

COLT approach to explaining Learning

•^

No Distributional Assumption

-^

Training Distribution is the same as the TestDistribution

-^

Generalization bounds dependon this view and affectsmodel selection. Err

(h) < ErrD

TR

(h)

P(VC(H), log(1/

δ ),1/m)

•^

This is also called the“Structural Risk Minimization” principle

CS446-Spring

COLT approach to explaining Learning

-^

No Distributional Assumption

-^

Training Distribution is the same as the Test Distribution

-^

Generalization bounds depend on this view and affect model selection.

Err

(h) < ErrD^

TR

(h)

+

P(VC(H), log(1/

δ ),1/m)

-^

As presented, the VC dimension is a combinatorial parameter that isassociated with a class of functions.

-^

We know that the class of linear functions has a lower VC dimension than theclass of quadratic functions.

-^

But, this notion can be refined to depend on a given data set, and this waydirectly affect the hypothesis chosen for this data set.

CS446-Spring

Margin and VC dimension

CS446-Spring

Margin and VC dimension

•^

Theorem (Vapnik):

If H is the space of all linear classifiers in

n^ that

separate the training data with margin at least

γ

, then

VC(H)

R

2 /γ

2

•^

where R is the radius of the smallest sphere (in

n^ ) that contains the

data.

-^

This is the first observation that will lead to algorithmic approach.

-^

The second one is that:

Small ||w||

Æ

Large Margin

•^

Consequently: the algorithm will be: from among all those w’s thatagree with the data, find the one with the minimal size ||w||

CS446-Spring

Key Problems

• Computational Issues

– Training and Evaluation with SVM is very time

consuming.

• Is it really optimal?

CS446-Spring Real Data

17,000 dimensional context sensitive spellingHistogram of distance of points from the hyperplane

CS446-Spring

Support Vector Machines

• Notice that the problem we solved is:

Min 1/2w

T^ w + c

i

• But this can be written as:

Min 1/2w

T^ w + max

(0, 1 – y

wi^

t^ x

).i^

• What is the interpretation of this?

CS446-Spring

Stochastic Gradient Descent for SVMs • Notice that the problem we solved is:

Min 1/2w

T^ w + c

i

• But this can be written as:

Min 1/2w

T^ w

max

(0, 1 – y

wi^

t^ x

).i^

• What is the interpretation of this?

Can be replaced by other

loss

functions

  • e.g. LMS

Can be replaced by other regularization functions (Linear rather than Quadratic)

Empirical loss

Regularization

term

CS446-Spring

Support Vector Machines – Additional

Material

SVM = Linear Classifier + Regularization + [Kernel Trick].

•^

Typically we are looking for the best w:

wopt

= argmin

∑w^

m 1 L(f(x,w,b),y)

Where L is a loss function that penalizes f when it makes a mistake.

-^

Typically, L is the 0-1 loss (hinge-loss):

L(y’, y)= ½ |y – sgn y’|

(y, y’

∈

{-1,1})

•^

Just optimizing with respect to the training data may lead tooverfitting. We want to achieve good performance on the trainingwhile maintaining some notion of “simple” hypothesis. We thereforechange our goal to:

wopt

= argmin

∑w^

m 1 L(f(x,w,b),y) +

λ

R(w)

Where L is a loss function, and R is a regularization function, which penalizes w

that results in a model that is too complex (high VC dimension).

λ

determines

the tradeoff between the empirical error and the regularization.

CS446-Spring

Support Vector Machines – Short Version^ SVM = Linear Classifier + Regularization + [Kernel Trick]. •

The fundamental result (Vapnik) that is at the heart of the SVMtheory is that:

Large Margin

Æ

Small VC dimension

•^

(What does it mean

? This is a data dependent notion; somewhat

different than the way we thought about it before)

-^

A key observation that allows an algorithmic approach is that:

Small ||w||

Æ

Large Margin

•^

This leads to an algorithm: from among all those w’s that agree withthe data, find the one with the minimal size ||w||

CS446-Spring

16

Support Vector Machines – Short Version^ SVM = Linear Classifier + Regularization + [Kernel Trick].

Minimize

½ ||w||

2

Subject to:

y(w

·^

x + b)

1, for all x

S

•^

The dual formulation of this optimization problems gives:

w =

αi

yi i^ x

i

•^

Optimum setting of

α

’s :

α

i^

i^ y (w

·^

i^ x +b -1 ) = 0

∀^

i

•^

That is,

α

¬i

=0 only when w

·^

i^ x +b -1=

•^

Those are the points sitting on the margin, call support vectors

-^

We get:

f(x,w,b) = w

·^

x +b =

αi

yi i^ x

i^ ·

x +b

•^

The value of the function depends on the

support vectors

, and only

on their dot product with the point of interest x.

1.^

Dependence on the dotproduct leads to the ability tointroduce kernels (just like inperceptron)

2.^

What if the data is not linearlyseparable?

3.^

What is the difference fromregularizedperceptron/Winnow?

CS446-Spring

SVM Notes

  • Chp. 5 of “Support Vector Machine” [Cristianini and

Shawe-Taylor] provides an introduction to thetheory of Optimization required in order tounderstand SVMs.

CS446-Spring

Optimization Problems

  • An optimization problem in which the objective

function and the constraints are linear is called alinear program.

  • If the objective function is quadratic and the

constraints linear it is called a quadratic program.

  • If the objective function, the constraints and the

domain of the functions are convex, that problem isa convex optimization problem.

CS446-Spring

20

Convexity

•^

A real valued function f(w) is called convex for w

R

n^ if,

w,u

R

n^ ,

and for any a

(0,1):^ f(aw + (1-a)u)

af(w) + (1-a) f(u)

•^

Claim: If a function is convex, any local minimum w

*^ of the

unconstrained optimization problem with objective function f is also aglobal minimum.

-^

Proof: Take any u><w

*^.^

By the definition of the local minimum there

exists a sufficiently close to 1 that

f(w

* )^

f(aw

    • (1-a)u)

af(w

  • ) + (1-a) f(u)

•^

Where the first inequality is a result of the assumption of localminimum and the second is from the convexity assumption. But thatimplies (algebra) that f(w

* )^

f(u)

•^

This is important. It renders optimization problems tractable whenthe functions involved are convex.

ww^

uu

f(wf(w)

)^

f(uf(u)

)