Docsity

Support Vector Machines: A Comprehensive Guide - Prof. Lise Getoor, Study notes of Computer Science

Toggle sidebar
bg1
1
CMSC726 Spring 2006:
Support Vector Machines
readings: available from class page
sources:
Andrew Moore http://www.cs.cmu.edu/~awm/tutorials
Tom Dietterich, Andrew Ng, Michael Littman, Rich Maclin
.
3 Views
|Geometric
zMaximizing Margin
|Kernel Methods
zMaking nonlinear decision boundaries linear
zEfficiently!
|Capacity
zStructural Risk Minimization
SVM History
|SVM is a classifier derived from statistical learning
theory by Vapnik and Chervonenkis
|SVM was first introduced by Boser, Guyon and Vapnik
in COLT-92
|SVM became famous when, using pixel maps as input,
it gave accuracy comparable to NNs with hand-
designed features in a handwriting recognition task
|SVM is closely related to:
zKernel machines (a generalization of SVMs), large
margin classifiers, reproducing kernel Hilbert s pace,
Gaussian process, Boosting
Linear Classifiers
f
x
α
yest
denotes +1
denotes -1
f(x,w,b) = sign(w. x -b)
How would you
classify this data?
Copyright © 2001, 2003, Andr ew W. Moore
Linear Classifiers
f
x
α
yest
denotes +1
denotes -1
f(x,w,b) = sign(w. x -b)
How would you
classify this data?
Copyright © 2001, 2003, Andr ew W. Moore
Linear Classifiers
f
x
α
yest
denotes +1
denotes -1
f(x,w,b) = sign(w. x -b)
How would you
classify this data?
Copyright © 2001, 2003, Andr ew W. Moore
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Support Vector Machines: A Comprehensive Guide - Prof. Lise Getoor and more Study notes Computer Science in PDF only on Docsity!

CMSC726 Spring 2006:

Support Vector Machines

readings: available from class page sources: Andrew Moore http://www.cs.cmu.edu/~awm/tutorials Tom Dietterich, Andrew Ng, Michael Littman, Rich Maclin .

3 Views

| Geometric

z Maximizing Margin

| Kernel Methods

z Making nonlinear decision boundaries linear

z Efficiently!

| Capacity

z Structural Risk Minimization

SVM History

| SVM is a classifier derived from statistical learning

theory by Vapnik and Chervonenkis

| SVM was first introduced by Boser, Guyon and Vapnik

in COLT-

| SVM became famous when, using pixel maps as input,

it gave accuracy comparable to NNs with hand-

designed features in a handwriting recognition task

| SVM is closely related to:

z Kernel machines (a generalization of SVMs), large margin classifiers, reproducing kernel Hilbert space, Gaussian process, Boosting

Linear Classifiers

x f

α

y est

denotes + denotes -

f ( x , w ,b) = sign( w. x - b)

How would you classify this data?

Copyright © 2001, 2003, Andrew W. Moore

Linear Classifiers

x f

α

y est denotes + denotes -1 f ( x , w ,b) = sign( w. x - b)

How would you classify this data?

Copyright © 2001, 2003, Andrew W. Moore

Linear Classifiers

x f

α

y est

denotes + denotes -

f ( x , w ,b) = sign( w. x - b)

How would you classify this data?

Copyright © 2001, 2003, Andrew W. Moore

Linear Classifiers

x f

α

y est

denotes + denotes -

f ( x , w ,b) = sign( w. x - b)

How would you classify this data?

Copyright © 2001, 2003, Andrew W. Moore

Linear Classifiers

x f

α

y est

denotes + denotes -

f ( x , w ,b) = sign( w. x - b)

Any of these would be fine..

..but which is best?

Copyright © 2001, 2003, Andrew W. Moore

Classifier Margin

x f

α

y est

denotes + denotes -

f ( x , w ,b) = sign( w. x - b)

Define the margin of a linear classifier as the width that the boundary could be increased by before hitting a datapoint.

Copyright © 2001, 2003, Andrew W. Moore

Maximum Margin

x f

α

y est

denotes + denotes -

f ( x , w ,b) = sign( w. x - b)

The maximum margin linear classifier is the linear classifier with the maximum margin. This is the simplest kind of SVM (Called an LSVM)

Linear SVM

Copyright © 2001, 2003, Andrew W. Moore

Maximum Margin

x f

α

y est

denotes + denotes -

f ( x , w ,b) = sign( w. x - b)

Support Vectors are those datapoints that the margin pushes up against Copyright © 2001, 2003, Andrew W. Moore

The maximum margin linear classifier is the linear classifier with the maximum margin. This is the simplest kind of SVM (Called an LSVM)

Linear SVM

Why Maximum Margin?

denotes + denotes -

f ( x , w ,b) = sign( w. x - b)

The maximum margin linear classifier is the linear classifier with the, um, maximum margin. This is the simplest kind of SVM (Called an LSVM)

Support Vectors are those datapoints that the margin pushes up against

  1. Intuitively this feels safest.
  2. If we’ve made a small error in the location of the boundary (it’s been jolted in its perpendicular direction) this gives us least chance of causing a misclassification.
  3. LOOCV is easy since the model is immune to removal of any non- support-vector datapoints.
  4. There’s some theory (using VC dimension) that is related to (but not the same as) the proposition that this is a good thing.
  5. Empirically it works very very well. Copyright © 2001, 2003, Andrew W. Moore

Specifying a line and margin

| How do we represent this mathematically?

| …in m input dimensions?

Plus-Plane

Minus-Plane

Classifier Boundary “Predict Class = +1”

zone

“Predict Class = -1”zone

Copyright © 2001, 2003, Andrew W. Moore

Specifying a line and margin

| Plus-plane = { x : w. x + b = +1 } | Minus-plane = { x : w. x + b = -1 }

Plus-Plane

Minus-Plane

Classifier Boundary “Predict Class = +1”

zone

“Predict Class = -1”zone

Classify as..

wx+b= wx+b= wx+b=-

Copyright © 2001, 2003, Andrew W. Moore

+1 if w. x + b >= 1

-1 if w. x + b <= - Universe if -1 < w. x + b < 1 explodes

Computing the margin width

| Plus-plane = { x : w. x + b = +1 } | Minus-plane = { x : w. x + b = -1 } Claim: The vector w is perpendicular to the Plus Plane. Why?

“Predict Class = +1”

zone

“Predict Class = -1”zone

wx+b= wx+b= wx+b=-

M = Margin Width

How do we computeM in

terms of w andb?

Copyright © 2001, 2003, Andrew W. Moore

Computing the margin width

| Plus-plane = { x : w. x + b = +1 } | Minus-plane = { x : w. x + b = -1 } Claim: The vector w is perpendicular to the Plus Plane. Why?

“Predict Class = +1”

zone

“Predict Class = -1”zone

wx+b= wx+b= wx+b=-

M = Margin Width

How do we computeM in

terms of w andb?

Let u and v be two vectors on the And so of course the vectorperpendicular to the Minus Plane w is alsoPlus Plane. What is w. ( u – v )?

Copyright © 2001, 2003, Andrew W. Moore

Computing the margin width

| Plus-plane = { x : w. x + b = +1 } | Minus-plane = { x : w. x + b = -1 } | The vector w is perpendicular to the Plus Plane | Let x -^ be any point on the minus plane | Let x +^ be the closest plus-plane-point to x -.

“Predict Class = +1”

zone

“Predict Class = -1”zone

wx+b= wx+b= wx+b=-

M = Margin Width

How do we compute

M in terms of w

andb?

x -

x +

Any location in ¨m: not necessarily a datapoint

Any location in R m: not necessarily a datapoint

Copyright © 2001, 2003, Andrew W. Moore

Computing the margin width

| Plus-plane = { x : w. x + b = +1 } | Minus-plane = { x : w. x + b = -1 } | The vector w is perpendicular to the Plus Plane | Let x- be any point on the minus plane | Let x+ be the closest plus-plane-point to x-. | Claim: x+ = x- + λ w for some value of λ. Why?

“Predict Class = +1”

zone

“Predict Class = -1”zone

wx+b= wx+b= wx+b=-

M = Margin Width

How do we computeM in

x terms of w andb?

x +

Copyright © 2001, 2003, Andrew W. Moore

Computing the margin width

| Plus-plane = { x : w. x + b = +1 } | Minus-plane = { x : w. x + b = -1 } | The vector w is perpendicular to the Plus Plane | Let x -^ be any point on the minus plane | Let x +^ be the closest plus-plane-point to x -. | Claim: x +^ = x -^ + λ w for some value of λ. Why?

“Predict Class = +1”zone

“Predict Class = -1”

wx+b=1 zone wx+b= wx+b=-

M = Margin Width

How do we computeM in

x terms of w andb?

x +

The line from x-^ to x+^ is perpendicular to the planes. So to get from x-^ to x+^ travel some distance in direction w.

Copyright © 2001, 2003, Andrew W. Moore

Computing the margin width

What we know: | w. x +^ + b = + | w. x -^ + b = - | x +^ = x -^ + λ w | | x +^ - x -^ | = M It’s now easy to get M in terms of w and b

“Predict Class = +1”

zone

“Predict Class = -1”zone

wx+b= wx+b= wx+b=-

M = Margin Width

x -

x +

Copyright © 2001, 2003, Andrew W. Moore

Computing the margin width

What we know: | w. x +^ + b = + | w. x -^ + b = - | x +^ = x -^ + λ w | | x +^ - x -^ | = M It’s now easy to get M in terms of w and b

“Predict Class = +1”

zone

“Predict Class = -1”zone

wx+b= wx+b= wx+b=-

M = Margin Width

w. ( x -^ + λ w) + b = 1

w. x -^ + b + λ w. w = 1

-1 + λ w. w = 1

x -

x +

w.w

Copyright © 2001 2003 Andrew W Moore

Computing the margin width

What we know: w. x +^ + b = + w. x -^ + b = - x +^ = x -^ + λ w | x +^ - x -^ | = M

“Predict Class = +1”

zone

“Predict Class = -1”

wx+b=1 zone wx+b= wx+b=-

M = Margin Width =

M = | x+^ - x -^ | =| λ w |=

x -

x +

w.w

λ =

ww ww

ww

= λ | w |= λ w. w

w. w

2

Copyright © 2001, 2003, Andrew W. Moore

Learning the Maximum Margin Classifier

Given a guess of w and b we can | Compute whether all data points are in the correct half-planes | Compute the width of the margin So now we just need to write a program to search the space of w ’s and b ’s to find the widest margin that matches all the datapoints. How? Gradient descent? Simulated Annealing? Matrix Inversion? EM? Newton’s Method?

“Predict Class = +1”zone

“Predict Class = -1”zone

wx+b= wx+b= wx+b=-

M = Margin Width =

x -

x +^ w. w

2

Copyright © 2001, 2003, Andrew W. Moore

Useful Stuff

| Linear Programming

find w

argmax c⋅ w

subject to

w ⋅ai ≤ bi , for i = 1, …, m

wj ≥ 0 for j = 1, …, n

Don’t worry… it’s good for you…

Don’t worry… it’s good for you…

There are fast algorithms for solving linear programs including the simplex algorithm and Karmarkar’s algorithm

Uh-oh!

denotes + denotes -

This is going to be a problem!

What should we do? Idea 1:

Find minimum w.w , while

minimizing number of training set errors. Problem: Two things to minimize makes for an ill- defined optimization

Copyright © 2001, 2003, Andrew W. Moore

Uh-oh!

denotes + denotes -

This is going to be a problem!

What should we do? Idea 1.1: Minimize

w.w + C (#train errors)

There’s a serious practical problem that’s about to make us reject this approach. Can you guess what it is?

Tradeoff parameter

Copyright © 2001, 2003, Andrew W. Moore

Uh-oh!

denotes + denotes -

This is going to be a problem! What should we do? Idea 1.1:

Minimize

w.w + C (#train errors)

There’s a serious practical problem that’s about to make us reject this approach. Can you guess what it is?

Tradeoff parameter Can’t be expressed as a Quadratic Programming problem. Solving it may be too slow. (Also, doesn’t distinguish between disastrous errors and near misses) So… any other ideas?

Copyright © 2001, 2003, Andrew W. Moore

Uh-oh!

denotes + denotes -

This is going to be a problem! What should we do? Idea 2.0:

Minimize

w.w + C (distance of error

points to their

correct place)

Copyright © 2001, 2003, Andrew W. Moore

Learning Maximum Margin with Noise

Given guess of w , b we can | Compute sum of distances of points to their correct zones | Compute the margin width Assume R datapoints, each ( x k ,y (^) k ) where y (^) k = +/- 1

wx+b= wx+b= wx+b=-

M =

w. w

2

What should our quadratic optimization criterion be?

How many constraints will we have? What should they be?

Copyright © 2001, 2003, Andrew W. Moore

Learning Maximum Margin with Noise

Given guess of w , b we can | Compute sum of distances of points to their correct zones | Compute the margin width Assume R datapoints, each ( x k ,y (^) k ) where y (^) k = +/- 1

wx+b= wx+b= wx+b=-

M =

w. w

2

What should our quadratic optimization criterion be?

How many constraints will we have? What should they be?

Copyright © 2001, 2003, Andrew W. Moore

Learning Maximum Margin with Noise

Given guess of w , b we can | Compute sum of distances of points to their correct zones | Compute the margin width Assume R datapoints, each ( x k ,y (^) k ) where y (^) k = +/- 1

wx+b= wx+b= wx+b=-

M =

w. w

2

What should our quadratic optimization criterion be? Minimize

=

R

k

C εk

1

ww

How many constraints will we have? R What should they be? w. x k + b >= 1- ε k if y (^) k = 1 w. x k + b <= -1+ ε k if y (^) k = -

Copyright © 2001, 2003, Andrew W. Moore

Learning Maximum Margin with Noise

Given guess of w , b we can | Compute sum of distances of points to their correct zones | Compute the margin width Assume R datapoints, each ( x k ,y (^) k ) where y (^) k = +/- 1

wx+b= wx+b= wx+b=-

M =

w. w

2

What should our quadratic optimization criterion be? Minimize

=

R

k

C εk

1

ww

ε 2 Our original (noiseless data) QP hadm+

variables:w 1 , w 2 , … w m , andb.

Our new (noisy data) QP hasm+1+R

variables:w 1 , w 2 , … w m , b, εk , ε 1 ,… εR

m = # input dimensions

How many constraints will we have? R What should they be? w. x k + b >= 1- ε k if y (^) k = 1 w. x k + b <= -1+ ε k if y (^) k = -

R= # records

Copyright © 2001, 2003, Andrew W. Moore

How many constraints will we have? R What should they be? w. x k + b >= 1- ε k if y (^) k = 1 w. x k + b <= -1+ ε k if y (^) k = -

Learning Maximum Margin with Noise

Given guess of w , b we can | Compute sum of distances of points to their correct zones | Compute the margin width Assume R datapoints, each ( x k ,y (^) k ) where y (^) k = +/- 1

wx+b= wx+b= wx+b=-

M =

w. w

2

What should our quadratic optimization criterion be? Minimize

=

R

k

C εk

1

ww

There’s a bug in this QP. Can you spot it? Copyright © 2001, 2003, Andrew W. Moore

Learning Maximum Margin with Noise

Given guess of w , b we can | Compute sum of distances of points to their correct zones | Compute the margin width Assume R datapoints, each ( x k ,y (^) k ) where y (^) k = +/- 1

wx+b= wx+b= wx+b=-

M =

w. w

2

What should our quadratic optimization criterion be? Minimize

How many constraints will we have? 2R What should they be? w. x k + b >= 1- ε k if y (^) k = 1 w. x k + b <= -1+ ε k if y (^) k = - ε k >= 0 for all k

=

R

k

C εk

1

ww

Copyright © 2001, 2003, Andrew W. Moore

An Equivalent Dual QP

Maximize ∑ ∑∑

= = =

R

k

R

l

k l kl

R

k

αk ααQ

where Qkl = ykyl ( x k. x l )

Subject to these constraints:

0 ≤ αk ≤ C ∀ k

Then define:

=

R

k

αk yk k

1

w x

k k

K K K K

K α

b y ε

where arg max

= − − x w

Then classify with: f ( x , w ,b) = sign( w. x - b)

1

∑^ =

=

R

k

αk yk

Copyright © 2001, 2003, Andrew W. Moore

Harder 1-dimensional dataset

Remember how permitting non- linear basis functions made linear regression so much nicer? Let’s permit them here too

x=0 (^ , )

2

z k = xk x k

Copyright © 2001, 2003, Andrew W. Moore

Common SVM basis functions

z k = ( polynomial terms of x k of degree 1 toq )

z k = ( radial basis functions of x k )

z k = ( sigmoid functions of x k )

This is sensible.

Is that the end of the story?

No…there’s one more trick!

KW

k [^ j ]^ φj ( k ) KernelFn k j

x c

z x

Copyright © 2001, 2003, Andrew W. Moore

Quadratic Basis

Functions

⎟⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎠

⎞

⎜⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎝

⎛

=

m − m

m

m

m

m

x x

xx

xx

xx

xx

xx

x

x

x

x

x

x

1

1

23

1

13

12

2

22

12

2

1

2

:

2

:

2

2

:

2

2

:

2

:

2

2

1

Φ ( x )

Constant Term

Linear Terms

Pure Quadratic Terms

Quadratic Cross-Terms

Number of terms (assuming m input dimensions) = (m+2)-choose- = (m+2)(m+1)/ = (as near as makes no difference) m 2 /

You may be wondering what those ’s are doing. •You should be happy that they do no harm •You’ll find out why they’re there soon.

Copyright © 2001, 2003, Andrew W. Moore

QP with basis functions

where Qkl = ykyl ( Φ ( x k ). Φ ( x l ))

Subject to these constraints:

0 ≤ αk ≤ C ∀ k

Then define:

k k

K K K K

K α

b y ε

where arg max

= − − x w

Then classify with:

f ( x , w ,b) = sign( w. φ ( x ) - b)

1

∑^ =

=

R

k

αk yk

s.t. 0

k α k

w α k yk Φ x k

Maximize ∑ ∑∑

= = =

R

k

R

l

k l kl

R

k

α k ααQ

Copyright © 2001, 2003, Andrew W. Moore

QP with basis functions

where Qkl = ykyl ( Φ ( x k ). Φ ( x l ))

Subject to these constraints:

0 ≤ αk ≤ C ∀ k

Then define:

k k

K K K K

K α

b y ε

where arg max

= − − x w

Then classify with:

f ( x , w ,b) = sign( w. φ ( x ) - b)

1

∑^ =

=

R

k

αk yk

We must do R 2 /2 dot products to get this matrix ready. Each dot product requires m^2 / additions and multiplications The whole thing costs R^2 m^2 /4. Yeeks! …or does it?…or does it?

s.t. 0

k α k

w α k yk Φ x k

Maximize ∑ ∑∑

= = =

R

k

R

l

k l kl

R

k

αk ααQ

Copyright © 2001, 2003, Andrew W. Moore

Quadratic DotProducts

⎟⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎠

⎞

⎜⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎝

⎛

⎟⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎟

⎠

⎞

⎜⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎜

⎝

⎛

  • =

− m − m

m

m

m

m

m m

m

m

m

m

b b

bb

bb

bb

bb

bb

b

b

b

b

b

b

a a

aa

aa

aa

aa

aa

a

a

a

a

a

a

1

1

23

1

13

12

2

(^22)

12

2

1

1

1

23

1

13

12

2

22

12

2

1

2

:

2

:

2

2

:

2

2

:

2

:

2

2

1

2

:

2

:

2

2

:

2

2

:

2

:

2

2

1

Φ ( a ) Φ ( b )

1

=

m i

ai bi 1

2

m i i^ i

ab 1

22

m i

m ji i^ jij

aabb 1 1

2

Copyright © 2001, 2003, Andrew W. Moore

Quadratic DotProducts

Φ ( a )• Φ ( b ) =

m i

m ji ijij

m i ii

m i i^ i

a b ab aabb 1 1 1

22 1

12 2

Just out of casual, innocent, interest, let’s look at another function of a and b : ( a. b + 1 )^2 = ( a. b )^2 + 2 a. b + 1

2 1 1

2 1

⎟+ + ⎠

⎜ ⎞ ⎝

= ⎛

m i ii

m i i^ i

ab ab

2 1 1 1 1

= = =

m i ii

m i

m j i^ ijj

abab ab

( ) 2 2 1 1 1 1 1

= = =+ =

m i

ii

m i

m ji

iijj

m i

ai bi abab ab

Copyright © 2001, 2003, Andrew W. Moore

Quadratic DotProducts

Φ ( a )• Φ ( b ) =

Just out of casual, innocent, interest, let’s look at another function of a and b : ( a. b + 1 )^2 = ( a. b )^2 + 2 a. b + 1

2 1 1

2 1

⎟+ + ⎠

⎜ ⎞ ⎝

= ⎛

m i ii

m i i^ i

ab ab

2 1 1 1 1

= = =

m i ii

m i

m j i^ ijj

abab ab

( ) 2 2 1 1 1 1 1

= = =+ =

m i

ii

m i

m ji

iijj

m i

ai bi abab ab

They’re the same! And this is only O(m) to compute!

m i

m ji ijij

m i ii

m i i^ i

a b ab aabb 1 1 1

22 1

12 2

Copyright © 2001, 2003, Andrew W. Moore

QP with Quadratic basis functions

where Qkl = ykyl ( Φ ( x k ). Φ ( x l ))

Subject to these constraints:

0 ≤ αk ≤ C ∀ k

Then define:

k k

K K K K

K α

b y ε

where arg max

= − − x w

Then classify with:

f ( x , w ,b) = sign( w. φ ( x ) - b)

1

∑^ =

=

R

k

αk yk

We must do R 2 /2 dot products to get this matrix ready. Each dot product now only requires m additions and multiplications

s.t. 0

k α k

w α k yk Φ x k

Maximize ∑ ∑∑

= = =

R

k

R

l

k l kl

R

k

αk ααQ

Copyright © 2001, 2003, Andrew W. Moore

Higher Order Polynomials

All m^4 /24 m^4 R 2 /48 1,960,000 R 2 ( a. b +1) 4 m R 2 / 2 50 R 2 terms up to degree 4

Quartic

All m^3 /6 terms m^3 R 2 /12 83,000 R 2 ( a. b +1) 3 m R 2 / 2 50 R 2 up to degree 3

Cubic

All m^2 /2 terms m^2 R 2 /4 2,500 R 2 ( a. b +1) 2 m R 2 / 2 50 R 2 up to degree 2

Quadratic

Cost if 100 inputs

Cost to build Q (^) kl matrix efficiently

Cost if 100 φ ( a ). φ ( b ) inputs

Cost to build Q (^) kl matrix traditionally

Polynomial φ ( x )

Copyright © 2001, 2003, Andrew W. Moore

QP with Quintic basis functions

Maximize ∑ ∑∑

= = =

R

k

R

l

k l kl

R

k

α k ααQ

1 1 1

where Qkl = ykyl ( Φ ( x k ). Φ ( x l ))

Subject to these constraints:

0 ≤ αk ≤ C ∀ k

Then define:

s.t. 0

k α k

w α k yk Φ x k

k k

K K K K

K α

b y ε

where arg max

= − − x w

Then classify with:

f ( x , w ,b) = sign( w. φ ( x ) - b)

1

∑^ =

=

R

k

αk yk

We must do R^2 /2 dot products to get this matrix ready. In 100-d, each dot product now needs 103 operations instead of 75 million But there are still worrying things lurking away. What are they?

Copyright © 2001, 2003, Andrew W. Moore

QP with Quintic basis functions

Maximize ∑ ∑∑

= = =

R

k

R

l

k l kl

R

k

αk ααQ

1 1 1

where Qkl = ykyl ( Φ ( x k ). Φ ( x l ))

Subject to these constraints:

0 ≤ αk ≤ C ∀ k

Then define:

s.t. 0

k α k

w α k yk Φ x k

k k

K K K K

K α

b y ε

where arg max

= − − x w

Then classify with:

f ( x , w ,b) = sign( w. φ ( x ) - b)

1

∑^ =

=

R

k

αk yk

We must do R^2 /2 dot products to get this matrix ready. In 100-d, each dot product now needs 103 operations instead of 75 million But there are still worrying things lurking away. What are they? •The fear of overfitting with this enormous number of terms •The evaluation phase (doing a set of predictions on a test set) will be very expensive(why?)

Copyright © 2001, 2003, Andrew W. Moore

Key SVM Ideas

| Maximize the margin between positive and

negative examples (connects to PAC theory)

| Penalize errors in non-separable case

| Only the support vectors contribute to the

solution

| Kernels map examples into a new, usually

non-linear space

z We implicitly do dot products in this new

space (in the “dual” form of the SVM

program)

SVM Performance

| Anecdotally they work very very well indeed.

| Example: They are currently the best-known

classifier on a well-studied hand-written-character

recognition benchmark

| Another Example: AWM knows several reliable

people doing practical real-world work who claim

that SVMs have saved them when their other

favorite classifiers did poorly.

| There is a lot of excitement and religious fervor

about SVMs and Kernel machines as of 2004.

| Despite this, some practitioners are a little

skeptical.

Copyright © 2001, 2003, Andrew W. Moore

Doing multi-class classification

| SVMs can only handle two-class outputs (i.e. a

categorical output variable with arity 2).

| What can be done?

| Answer: with output arity N, learn N SVM’s

z SVM 1 learns “Output==1” vs “Output != 1” z SVM 2 learns “Output==2” vs “Output != 2” z : z SVM N learns “Output==N” vs “Output != N”

| Then to predict the output for a new input, just

predict with each SVM and find out which one puts

the prediction the furthest into the positive region.

Copyright © 2001, 2003, Andrew W. Moore

SVM Implementations

| Sequential Minimal Optimization, SMO,

efficient implementation of SVMs, Platt

z in Weka

| SVMlight

z http://svmlight.joachims.org/

| LibSVM

z http://www.csie.ntu.edu.tw/~cjlin/libsvm/

References

| Tutorial on VC-dimension and Support

Vector Machines:

C. Burges. A tutorial on support vector machines for pattern recognition. Data Mining and Knowledge Discovery, 2(2):955-974, 1998. http://citeseer.nj.nec.com/burges98tutorial.html

| The VC/SRM/SVM Bible:

Statistical Learning Theory by Vladimir Vapnik, Wiley-Interscience; 1998

Copyright © 2001, 2003, Andrew W. Moore