Presentation is loading. Please wait.

Presentation is loading. Please wait.

Roughly overview of Support vector machines Reference: 1.Support vector machines and machine learning on documents. Christopher D. Manning, Prabhakar Raghavan.

Similar presentations


Presentation on theme: "Roughly overview of Support vector machines Reference: 1.Support vector machines and machine learning on documents. Christopher D. Manning, Prabhakar Raghavan."— Presentation transcript:

1 Roughly overview of Support vector machines Reference: 1.Support vector machines and machine learning on documents. Christopher D. Manning, Prabhakar Raghavan and Hinrich Schütze. An Introduction of Information Retrieval, 2008. 2.Support Vector Machines: Training and Application. E. Osuna, et al. MIT A. I. Lab, 1997. 3.An Improved Training Algorithm for Support Vector Machines. E. Osuna, et al. IEEE NNSP’97. 4.A Tutorial on Support Vector Machines for Pattern Recognition. J.C. Burges. Data Mining and Knowledge Discovery, 1998. 5.A probabilistic Analysis of the Rocchio Algorithm with TFIDF for Text Categorization. T.Joachims. NIPS, 1997. 6.Text Categorization with Support Vector Machines: Learning with Many Relevant Features. T.Joachims. 1997. 7.http://www-csli.stanford.edu/~hinrich/information-retrieval-book.htmlhttp://www-csli.stanford.edu/~hinrich/information-retrieval-book.html 8.http://www-csli.stanford.edu/~hinrich/newslides.htmlhttp://www-csli.stanford.edu/~hinrich/newslides.html 9.http://en.wikipedia.org/wiki/Quadratic_programminghttp://en.wikipedia.org/wiki/Quadratic_programming 10.http://www.cmlab.csie.ntu.edu.tw/~cyy/learning/tutorials/SVM3.pdfhttp://www.cmlab.csie.ntu.edu.tw/~cyy/learning/tutorials/SVM3.pdf Presenter: Suhan Yu

2 The main idea of SVM An SVM is a kind of large-margin classifier To find a decision boundary between two classes The subject have started in the late seventies by Vapnik (1979) Master : Mathematics Vladimir Naumovich Vapnik Russian Ph. D : Statistics

3 The application of SVM Isolated handwritten digit recognition Object recognition Speaker identification Face detection Text categorization –Joachims, 1997

4 Text classification Earlier –TFIDF classifier –k-NN

5 Text classification Earlier –Naïve Bayes Classifier –Rocchio –… Today –SVM

6 Why should SVMs Work Well for Text categorization High dimension input space –Learning text classifiers has to deal with more than 10000 features Few irrelevant features –The relation between features is high Document vectors are sparse

7 The main idea of SVM hyperplane margin

8 Support Vector Machine (SVM) Support vectors Maximize margin SVMs maximize the margin around the separating hyperplane. –A.k.a. large margin classifiers The decision function is fully specified by a subset of training samples, the support vectors. Quadratic programming problem

9 w: decision hyperplane normal x i : data point i y i : class of data point i (+1 or -1) NB: Not 1/0 Classifier is: f(x i ) = sign(w T x i + b) Functional margin of x i is: y i (w T x i + b) Maximum Margin: Formalization

10 The planar decision surface in data-space for the simple linear discriminant function: X’

11 Linear Support Vector Machine (SVM) Hyperplane w T x + b = 0 Extra scale constraint: min i=1,…,n |w T x i + b| = 1 This implies: w T (x a –x b ) = 2 ρ = ||x a –x b || 2 = 2/||w|| 2 w T x + b = 0 w T x a + b = 1 w T x b + b = -1 ρ

12 Linear SVM Mathematically Assume that all data is at least distance 1 from the hyperplane, then the following two constraints follow for a training set {(x i,y i )} For support vectors, the inequality becomes an equality Then, since each example’s distance from the hyperplane is The margin is: w T x i + b ≥ 1 if y i = 1 w T x i + b ≤ -1 if y i = -1

13 Geometric Margin Distance from example to the separator is Examples closest to the hyperplane are support vectors. Margin ρ of the separator is the width of separation between support vectors of classes. r ρ x x′x′

14 Linear SVM Mathematically To summarize: Quadratic function –A quadratic function f is a function of the form Convex function a point x to be a global minimizer is for it to satisfy the Karush-Kuhn-Tucker (KKT) conditions. The KKT conditions are also sufficient when f(x) is convex.

15 Linear SVM Mathematically Lagrange Multiplier Differentiating:

16 An example of SVM ◎

17 Non-linear SVMs Datasets that are linearly separable (with some noise) work out great: But what are we going to do if the dataset is just too hard? How about … mapping data to a higher-dimensional space: 0 x2x2 x 0 x 0 x

18 Nonlinear SVMs Project the linearly inseparable data to high dimensional space where it is linearly separable and then we can use linear SVM 0+1 ++- (1,0) (0,0) (0,1) + + -

19 0 5 Not linearly separable data. Need to transform the coordinates: polar coordinates, kernel transformation into higher dimensional space (support vector machines). Distance from center (radius) Angular degree (phase) Linearly separable data. polar coordinates

20 Non-linear SVMs: Feature spaces Φ: x → φ(x)

21 (cont’d) Kernel functions and the kernel trick are used to transform data into a different linearly separable feature space  (.)  ( ) Feature space Input space

22 Soft Margin Classification If the training set is not linearly separable, slack variables ξ i can be added to allow misclassification of difficult or noisy examples. Allow some errors –Let some points be moved to where they belong, at a cost Still, try to minimize training set errors, and to place hyperplane “far” from each class (large margin) ξjξj ξiξi

23 Soft Margin Classification Mathematically The old formulation: The new formulation incorporating slack variables: Parameter C can be viewed as a way to control overfitting – a regularization term Find w and b such that Φ(w) =½ w T w is minimized and for all { ( x i,y i )} y i (w T x i + b) ≥ 1 Find w and b such that Φ(w) =½ w T w + C Σ ξ i is minimized and for all { ( x i,y i )} y i (w T x i + b) ≥ 1- ξ i and ξ i ≥ 0 for all i

24 Soft Margin Classification – Solution The dual problem for soft margin classification: Neither slack variables ξ i nor their Lagrange multipliers appear in the dual problem! Again, x i with non-zero α i will be support vectors. Solution to the dual problem is: Find α 1 …α N such that Q( α ) = Σ α i - ½ ΣΣ α i α j y i y j x i T x j is maximized and (1) Σ α i y i = 0 (2) 0 ≤ α i ≤ C for all α i w = Σ α i y i x i b= y k (1- ξ k ) - w T x k where k = argmax α k k f(x) = Σ α i y i x i T x + b But w not needed explicitly for classification!

25 Classification with SVMs Given a new point (x 1,x 2 ), we can score its projection onto the hyperplane normal: –In 2 dims: score = w 1 x 1 +w 2 x 2 +b. –I.e., compute score: wx + b = Σα i y i x i T x + b –Set confidence threshold t. 3 5 7 Score > t: yes Score < -t: no Else: don’t know

26 Kernels Why use kernels? –Make non-separable problem separable. –Map data into better representational space Common kernels –Linear –Polynomial K(x,z) = (1+x T z) d –Radial basis function (infinite dimensional space)

27 The problem of SVM Training a SVM using large data sets (5000 samples) is a very difficult problem to approach without some kind of data or problem decomposition [Osuna, 1997]

28 Features for text Good feature engineering can often markedly improve the performance of a text classifier Use terms as features Document zones –Upweighting document zones –Separate features spaces for document zones –Connections to text summarization Relevance signal –Cosine score –Title match Query term proximity is often very indicative of a document being in topic, especially with longer documents and on the web

29 Result ranking by machine learning Classification problem v.s. regression problem –Classification problem: categorical variable is predicted –Regression problem: a real number is predicted Ordinal regression –Ranking is predicted –The goal is to rank a set of documents for a query –Ranking SVM

30 Ranking SVM Construct a vector of features for each document/query pair For two documents, form the vector of feature differences Another ranking methods –RankNet : using neural network for ranking –Frank : different from cost function


Download ppt "Roughly overview of Support vector machines Reference: 1.Support vector machines and machine learning on documents. Christopher D. Manning, Prabhakar Raghavan."

Similar presentations


Ads by Google