






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























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
Idea #1: minimize w · w, while also minimizing number of training errors
Non-separable case
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
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
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
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
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
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
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
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
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
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
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?