SVM by Sequential Minimal Optimization (SMO)

Slides:



Advertisements
Similar presentations
3.6 Support Vector Machines
Advertisements

Introduction to Support Vector Machines (SVM)
Sequential Minimal Optimization Advanced Machine Learning Course 2012 Fall Semester Tsinghua University.
SVM - Support Vector Machines A new classification method for both linear and nonlinear data It uses a nonlinear mapping to transform the original training.
A KTEC Center of Excellence 1 Pattern Analysis using Convex Optimization: Part 2 of Chapter 7 Discussion Presenter: Brian Quanz.
Support Vector Machines Instructor Max Welling ICS273A UCIrvine.
Support Vector Machines
CSCI 347 / CS 4206: Data Mining Module 07: Implementations Topic 03: Linear Models.
Separating Hyperplanes
University of Texas at Austin Machine Learning Group Department of Computer Sciences University of Texas at Austin Support Vector Machines.
Prénom Nom Document Analysis: Linear Discrimination Prof. Rolf Ingold, University of Fribourg Master course, spring semester 2008.
Using Analytic QP and Sparseness to Speed Training of Support Vector Machines John C. Platt Presented by: Travis Desell.
Support Vector Classification (Linearly Separable Case, Primal) The hyperplanethat solves the minimization problem: realizes the maximal margin hyperplane.
Classification Problem 2-Category Linearly Separable Case A- A+ Malignant Benign.
Support Vector Machine (SVM) Classification
Sketched Derivation of error bound using VC-dimension (1) Bound our usual PAC expression by the probability that an algorithm has 0 error on the training.
Binary Classification Problem Learn a Classifier from the Training Set
Lecture 10: Support Vector Machines
Greg GrudicIntro AI1 Support Vector Machine (SVM) Classification Greg Grudic.
SVMs, cont’d Intro to Bayesian learning. Quadratic programming Problems of the form Minimize: Subject to: are called “quadratic programming” problems.
CSCI 347 / CS 4206: Data Mining Module 04: Algorithms Topic 06: Regression.
Introduction While it may not be efficient to write out the justification for each step when solving equations, it is important to remember that the properties.
Support Vector Machines
Machine Learning Week 4 Lecture 1. Hand In Data Is coming online later today. I keep test set with approx test images That will be your real test.
Linear hyperplanes as classifiers Usman Roshan. Hyperplane separators.
Topics on Final Perceptrons SVMs Precision/Recall/ROC Decision Trees Naive Bayes Bayesian networks Adaboost Genetic algorithms Q learning Not on the final:
CS 8751 ML & KDDSupport Vector Machines1 Support Vector Machines (SVMs) Learning mechanism based on linear programming Chooses a separating plane based.
Support Vector Machines Mei-Chen Yeh 04/20/2010. The Classification Problem Label instances, usually represented by feature vectors, into one of the predefined.
An Introduction to Support Vector Machine (SVM) Presenter : Ahey Date : 2007/07/20 The slides are based on lecture notes of Prof. 林智仁 and Daniel Yeung.
Data Mining Practical Machine Learning Tools and Techniques Chapter 4: Algorithms: The Basic Methods Section 4.6: Linear Models Rodney Nielsen Many of.
Support Vector Machines Reading: Ben-Hur and Weston, “A User’s Guide to Support Vector Machines” (linked from class web page)
CS Statistical Machine learning Lecture 18 Yuan (Alan) Qi Purdue CS Oct
Computational Intelligence: Methods and Applications Lecture 23 Logistic discrimination and support vectors Włodzisław Duch Dept. of Informatics, UMK Google:
Machine Learning Weak 4 Lecture 2. Hand in Data It is online Only around 6000 images!!! Deadline is one week. Next Thursday lecture will be only one hour.
START OF DAY 5 Reading: Chap. 8. Support Vector Machine.
CISC667, F05, Lec22, Liao1 CISC 667 Intro to Bioinformatics (Fall 2005) Support Vector Machines I.
CS 478 – Tools for Machine Learning and Data Mining SVM.
Kernel Methods: Support Vector Machines Maximum Margin Classifiers and Support Vector Machines.
Linear hyperplanes as classifiers Usman Roshan. Hyperplane separators.
Biointelligence Laboratory, Seoul National University
An Introduction to Support Vector Machine (SVM)
CSSE463: Image Recognition Day 14 Lab due Weds, 3:25. Lab due Weds, 3:25. My solutions assume that you don't threshold the shapes.ppt image. My solutions.
1  The Problem: Consider a two class task with ω 1, ω 2   LINEAR CLASSIFIERS.
Support Vector Machines
1  Problem: Consider a two class task with ω 1, ω 2   LINEAR CLASSIFIERS.
Support Vector Machines Tao Department of computer science University of Illinois.
Support Vector Machines. Notation Assume a binary classification problem. –Instances are represented by vector x   n. –Training examples: x = (x 1,
© Eric CMU, Machine Learning Support Vector Machines Eric Xing Lecture 4, August 12, 2010 Reading:
Lecture notes for Stat 231: Pattern Recognition and Machine Learning 1. Stat 231. A.L. Yuille. Fall 2004 Linear Separation and Margins. Non-Separable and.
Support Vector Machines Reading: Ben-Hur and Weston, “A User’s Guide to Support Vector Machines” (linked from class web page)
Linear hyperplanes as classifiers Usman Roshan. Hyperplane separators.
SVMs, Part 2 Summary of SVM algorithm Examples of “custom” kernels Standardizing data for SVMs Soft-margin SVMs.
Greg GrudicIntro AI1 Support Vector Machine (SVM) Classification Greg Grudic.
Computational Intelligence: Methods and Applications Lecture 24 SVM in the non-linear case Włodzisław Duch Dept. of Informatics, UMK Google: W Duch.
Kernel Methods: Support Vector Machines Maximum Margin Classifiers and Support Vector Machines.
Support Vector Machine: An Introduction. (C) by Yu Hen Hu 2 Linear Hyper-plane Classifier For x in the side of o : w T x + b  0; d = +1; For.
CSSE463: Image Recognition Day 14 Lab due Weds. Lab due Weds. These solutions assume that you don't threshold the shapes.ppt image: Shape1: elongation.
Page 1 CS 546 Machine Learning in NLP Review 2: Loss minimization, SVM and Logistic Regression Dan Roth Department of Computer Science University of Illinois.
Support Vector Machines Reading: Textbook, Chapter 5 Ben-Hur and Weston, A User’s Guide to Support Vector Machines (linked from class web page)
CSE343/543 Machine Learning Mayank Vatsa Lecture slides are prepared using several teaching resources and no authorship is claimed for any slides.
Support vector machines
LINEAR CLASSIFIERS The Problem: Consider a two class task with ω1, ω2.
Large Margin classifiers
Perceptrons Support-Vector Machines
CS 4/527: Artificial Intelligence
CSSE463: Image Recognition Day 14
Support vector machines
Support Vector Machines
Support vector machines
Support vector machines
Presentation transcript:

SVM by Sequential Minimal Optimization (SMO) Algorithm by John Platt Lecture by David Page CS 760: Machine Learning

Quick Review Inner product (specifically here the dot product) is defined as Changing x to w and z to x, we may also write: or or wTx or w x In our usage, x is feature vector and w is weight (or coefficient) vector A line (or more generally a hyperplane) is written as wTx = b, or wTx - b = 0 A linear separator is written as sign(wTx - b)

Quick Review (Continued) Recall in SVMs we want to maximize margin subject to correctly separating the data… that is, we want to: Here the y’s are the class values (+1 for positive and -1 for negative), so says xi correctly labeled with room to spare Recall is just wTw

Recall Full Formulation As last lecture showed us, we can Solve the dual more efficiently (fewer unknowns) Add parameter C to allow some misclassifications Replace xiTxj by more more general kernel term

Intuitive Introduction to SMO Perceptron learning algorithm is essentially doing same thing – find a linear separator by adjusting weights on misclassified examples Unlike perceptron, SMO has to maintain sum over examples of example weight times example label Therefore, when SMO adjusts weight of one example, it must also adjust weight of another

An Old Slide: Perceptron as Classifier Output for example x is sign(wTx) Candidate Hypotheses: real-valued weight vectors w Training: Update w for each misclassified example x (target class t, predicted o) by: wi wi + h(t-o)xi Here h is learning rate parameter Let E be the error o-t. The above can be rewritten as w w – hEx So final weight vector is a sum of weighted contributions from each example. Predictive model can be rewritten as weighted combination of examples rather than features, where the weight on an example is sum (over iterations) of terms –hE.

Corresponding Use in Prediction To use perceptron, prediction is wTx - b. May treat -b as one more coefficient in w (and omit it here), may take sign of this value In alternative view of last slide, prediction can be written as or, revising the weight appropriately, Prediction in SVM is:

From Perceptron Rule to SMO Rule Recall that SVM optimization problem has the added requirement that: Therefore if we increase one  by an amount h, in either direction, then we have to change another  by an equal amount in the opposite direction (relative to class value). We can accomplish this by changing: w w – hEx also viewed as:   – yhE to: 1 1 – y1h(E1-E2) or equivalently: 1 1 + y1h(E2-E1) We then also adjust 2 so that y11 + y22 stays same

First of Two Other Changes Instead of h = or some similar constant, we set h = or more generally h = For a given difference in error between two examples, the step size is larger when the two examples are more similar. When x1 and x2 are similar, K(x1,x2) is larger (for typical kernels, including dot product). Hence the denominator is smaller and step size is larger.

Second of Two Other Changes Recall our formulation had an additional constraint: Therefore, we “clip” any change we make to any  to respect this constraint This yields the following SMO algorithm. (So far we have motivated it intuitively. Afterward we will show it really minimizes our objective.)

Updating Two ’s: One SMO Step Given examples e1 and e2, set where: Clip this value in the natural way: if y1 = y2 then: otherwise: Set where s = y1y2

Karush-Kuhn-Tucker (KKT) Conditions It is necessary and sufficient for a solution to our objective that all ’s satisfy the following: An  is 0 iff that example is correctly labeled with room to spare An  is C iff that example is incorrectly labeled or in the margin An  is properly between 0 and C (is “unbound”) iff that example is “barely” correctly labeled (is a support vector) We just check KKT to within some small epsilon, typically 10-3

SMO Algorithm Input: C, kernel, kernel parameters, epsilon Initialize b and all ’s to 0 Repeat until KKT satisfied (to within epsilon): Find an example e1 that violates KKT (prefer unbound examples here, choose randomly among those) Choose a second example e2. Prefer one to maximize step size (in practice, faster to just maximize |E1 – E2|). If that fails to result in change, randomly choose unbound example. If that fails, randomly choose example. If that fails, re-choose e1. Update α1 and α2 in one step Compute new threshold b

At End of Each Step, Need to Update b Compute b1 and b2 as follows Choose b = (b1 + b2)/2 When α1 and α2 are not at bound, it is in fact guaranteed that b = b1 = b2

Derivation of SMO Update Rule Recall objective function we want to optimize: Can write objective as: where: Starred values are from end of previous round α2 with everybody else α1 with everybody else all the other α’s

Expressing Objective in Terms of One Lagrange Multiplier Only Because of the constraint , each update has to obey: where w is a constant and s is y1y2 This lets us express the objective function in terms of α2 alone:

Find Minimum of this Objective Find extremum by first derivative wrt α2: If second derivative positive (usual case), then the minimum is where (by simple Algebra, remembering ss = 1):

Finishing Up Recall that w = and So we can rewrite as: = s(K11-K12)(sα2*+α1*) + y2(u1-u2+y1α1*(K12-K11) + y2α2*(K22-K21)) +y2y2 –y1y2 We can rewrite this as:

Finishing Up Based on values of w and v, we rewrote as: From this, we get our update rule: where u1 – y1 u2 – y2 K11 + K22 – 2K12