Professional Documents
Culture Documents
Outline
A Brief History of SVM SVM: A Large-Margin Classifier
Linear SVM Kernel Trick Fast implementation: SMO
History of SVM
SVM is inspired from statistical learning theory [3] SVM was first introduced in 1992 [1] SVM becomes popular because of its success in handwritten digit recognition
1.1% test error rate for SVM. This is the same as the error rates of a carefully constructed neural network, LeNet 4.
See Section 5.11 in [2] or the discussion in [3] for details
SVM is now regarded as an important example of kernel methods, arguably the hottest area in machine learning
[1] B.E. Boser et al. A Training Algorithm for Optimal Margin Classifiers. Proceedings of the Fifth Annual Workshop on Computational Learning Theory 5 144-152, Pittsburgh, 1992. [2] L. Bottou et al. Comparison of classifier methods: a case study in handwritten digit recognition. Proceedings of the 12th IAPR International Conference on Pattern Recognition, vol. 2, pp. 77-82, 1994. [3] V. Vapnik. The Nature of Statistical Learning Theory. 2nd edition, Springer, 1999.
Class 1
Class 1
Class 1
Class 2
Class 1
This is a quadratic
A global maximum
If the number of training examples is large, SVM training programming (QP) problem because the will be very slow number of ai can always be found of parameters Alpha is very large in the dual problem.
w can be recovered by
KTT Condition
The QP problem is solved when for all i,
A Geometrical Interpretation
Class 2
a8=0.6 a10=0
a5=0
a4=0 a9=0
Class 1
a7=0
a2=0
Class 1
xi are slack variables in optimization; xi=0 if there is no error for xi, and xi is an upper bound of the number of errors
We want to minimize
C : tradeoff parameter between error and margin
w is recovered as This is very similar to the optimization problem in the linear separable case, except that there is an upper bound C on ai now Once again, a QP solver can be used to find ai
Why transform?
Linear operation in the feature space is equivalent to non-linear operation in input space Classification can become easier with a proper transformation. In the XOR problem, for example, adding a new feature of x1x2 make the problem linearly separable
Input space
Feature space
The data points only appear as inner product As long as we can calculate the inner product in the feature space, we do not need the mapping explicitly Many common geometric operations (angles, distances) can be expressed by inner products Define the kernel function K by
So, if we define the kernel function as follows, there is no need to carry out f(.) explicitly
This use of kernel function to avoid carrying out f(.) explicitly is known as the kernel trick
Kernel Functions
In practical use of SVM, only the kernel function (and not f(.)) is specified Kernel function can be thought of as a similarity measure between the input objects Not all similarity measure can be used as kernel function, however Mercer's condition states that any positive semi-definite kernel K(x, y), i.e.
Vapnik argues that the fundamental problem is not the number of parameters to be estimated. Rather, the problem is about the flexibility of a classifier Typically, a classifier with many parameters is very flexible, but there are also exceptions
Let xi=10i where i ranges from 1 to n. The classifier can classify all xi correctly for all possible combination of class labels on xi This 1-parameter classifier is very flexible
The addition of ||w||2 has the effect of restricting the VC-dimension of the classifier in the feature space The SVM objective can also be justified by structural risk minimization: the empirical risk (training error), plus a term related to the generalization ability of the classifier, is minimized Another view: the SVM loss function is analogous to ridge regression. The term ||w||2 shrinks the parameters towards zero to avoid overfitting
It scales relatively well to high dimensional data Tradeoff between classifier complexity and error can be controlled explicitly Non-traditional data like strings and trees can be used as input to SVM, instead of feature vectors By performing logistic regression (Sigmoid) on the SVM output of a set of data can map SVM output to probabilities.
Weaknesses
Execute the training algorithm and obtain the ai Unseen data can be classified using the ai and the support vectors
SMO
At each step, SMO chooses 2 Lagrange multipliers to jointly optimize, find the optimal values for these multipliers and updates the SVM to reflect the new optimal values. Three components
An analytic method to solve for the two Lagrange multipliers A heuristic for choosing which multipliers to optimize A method for computing b at each step, so that the KTT conditions are fulfilled for both the two examples
Second multiplier
Maximize the size of step taken during joint optimization. |E1-E2|, where Ei is the error on the i-th example.
Text Categorization
Typical features
Term frequency Inverse document frequency
K-class SVM
1-vs-rest
For any class C, train a binary classifier to distinguish C from C. For an unseen sample, find the binary classifier with highest confidence score for the final decision.
1-vs-1
Train CN2 classifiers, which distinguish one class from another one.
Pairwise:
MaxWin (CN2 tests) Error-correcting output code
DAG:
Pachinko-machine (N tests)
Intransitivity of DAG
For C1C2C3, if C3 d C2 , C2 d C1 , then C3 d C1 , we say d is transitive.
C3
2~3
2~1
1~3
C2
1~3
1
1~2
C1
1~2 2~3 1~3 3~2
Divided-by-2 (DB2)
Hierarchically divide the data into two subsets until every subset consists of only one class.
Divided-by-2 (DB2)
Data partitioning criterion:
group the classes such that the resulting subsets have the largest margin.
K-class SVM
Change the loss function and constraints
Whole-vs-part
Common for parent-child relationship
Add an Other category, and do binary classification to distinguish the child from the other category. Since the classification boundary is non-linear, kernel methods may be more effective.
Mode-N
consider the multi-label data as a new class
Mode-X
Use the multi-label data more than once, using each example as a positive example of each of the classes to which it belongs.
S-cut
Train a threshold for each class by cross validation, and Label input testing data by all of the classes corresponding to higher scores than the threshold.
R-cut
For any given test instance, always assign it r labels according to the decedent confidence scores. r can be learned from training data.
Evaluation Criteria
Micro-F1:
Measure the overall classification accuracy (more consistent with the practical application scenario)
Macro-F1:
Measure the classification accuracy on the category level. Can reflect the classifiers capability of dealing with rare categories.
References
Martin Law, A Simple Introduction to Support Vector Machines. Bredensteiner, E. J., and Bennett, K. P. Multicategory Classification by Support Vector Machines, Computer Optimization and Applications. 5379, 1999. Dumais, S., Chen, H. Hierarchical classification of Web content, In Proc. SIGIR, 256-263, 2000. Platt, J. Fast training of support vector machines using sequential minimal optimization. Advances in Kernel Methods - Support Vector Learning, 185-208, MIT Press, Cambridge, MA, 1999. Yang, Y., Zhang, J., and Kisiel, B. A scalability analysis of classifiers in text categorization. SIGIR, 96-103, 2003. Yang, Y. A study of thresholding strategies for text categorization, SIGIR, 137-145, 2001. Tie-Yan Liu, Yiming Yang, Hao Wan, et al, Support Vector Machines Classification with Very Large Scale Taxonomy, SIGKDD Explorations, Special Issue on Text Mining and Natural Language Processing, vol.7, issue.1, pp36~43, 2005.
Thanks
tyliu@microsoft.com http://research.microsoft.com/users/tyliu