Docsity

Lecture Slides on Support Vector Learning | CSI 5325, Study notes of Computer Science

Partial preview of the text

Download Lecture Slides on Support Vector Learning | CSI 5325 and more Study notes Computer Science in PDF only on Docsity!

Intro. to machine learning (CSI 5325)

Lecture 22: Support vector learning

Greg Hamerly

Spring 2008

Some content from Andrew Moore http://www.cs.cmu.edu/∼awm/tutorials.

Outline

1 Non-separable case

2 Nonlinear SVMs

3 Kernel methods

Non-separable case

Compensating for non-separable data: approach 1

Idea #1: minimize w · w, while also minimizing number of training errors

Non-separable case

Compensating for non-separable data: approach 1

Idea #1: minimize w · w, while also minimizing number of training errors

Problem with this: Now we have to minimize two things, which makes the optimization ill-defined.

Non-separable case

Compensating for non-separable data: approach 1.

Idea #1.1: minimize w · w + C (# train errors) where C is a user-chosen tradeoff parameter

Problems with this: This can’t be expressed as a QP problem. May be slow to implement. Doesn’t distinguish between disastrous errors and near misses.

Non-separable case

Compensating for non-separable data: approach 2

Idea #2: minimize

w·w+C (distance of misclassified points to their correct places)

where C is a user-chosen tradeoff parameter

So how do we express this as a QP optimization? introduce ‘slack variables’ ξi into our constraints

Non-separable case

Learning the maximum margin – with noise

In the separable case, we had the following: minimize w · w Subject to n constraints: w · xi − b ≥ 1 if yi = 1 w · xi − b ≤ −1 if yi = − 1

Non-separable case

Learning the maximum margin – with noise

In the separable case, we had the following: minimize w · w Subject to n constraints: w · xi − b ≥ 1 if yi = 1 w · xi − b ≤ −1 if yi = − 1

Now in the non-separable case, we have: minimize w · w+C

∑n i=1 ξi Subject to 2n constraints: w · xi − b ≥ 1 −ξi if yi = 1 w · xi − b ≤ −1+ξi if yi = − 1 ξi ≥ 0

Non-separable case

Finding w and b from the dual’s solution

After maximizing with respect to αi , we can find:

w =

∑^ n

i=

αi yi xi

b = yi (1 − ξi ) − xi · wi

Examples with αi > 0 will be the support vectors. (Remember that 0 ≤ αi ≤ C .)

Thus, finding w needs only sum over the support vectors.

Nonlinear SVMs

1-dimensional data – simple

What would a linear SVM do with this data?

x = 0 −−−−^ PositiveNegative^ exampleexample

Where is the decision plane? Where are the support vectors?

Nonlinear SVMs

1-dimensional data – basis expansion

Take the data and apply a basis expansion to two dimensions: x → Φ(x) = [x, x^2 ]

x = 0 −− Positive example−− Negative example

Now it’s linearly separable! (In the expanded space...) Also, w now lives in the expanded space. (^) 16 / 30

Nonlinear SVMs

Common SVM basis expansions

polynomial terms of x of degrees 1 to p radial basis function of x sigmoid function of x

How do we define these? Hold that thought...

Nonlinear SVMs

QP with basis functions

Maximize (over αi ):

∑^ n

i=

αi −

∑^ n

i

∑n

j

αi αj yi yj Φ(xi )·Φ(xj )

Subject to: 0 ≤ αi ≤ C ,

∑^ n

i=

αi yi = 0

Where we can again get the original parameters w and b as:

w =

∑^ n

i=

αi yi Φ(xi )

b = yi (1 − ξi ) − Φ(xi ) · w (compare these with the linear formulation a few slides back)

Nonlinear SVMs

QP with basis functions

Maximize (over αi ):

∑^ n

i=

αi −

∑^ n

i

∑n

j

αi αj yi yj Φ(xi )·Φ(xj )

How many dot products between Φ(xi ) and Φ(xj ) do we need?

≈ n^2 /2 dot products each dot product costs ≈ d^2 /2 additions and multiplications total cost: ≈ n^2 d^2 /4 – quite large! Can we reduce this cost?