Sequential Minimal Optimization for SVM
Contents
1 Introduction to Support Vector Machine (SVM) 2
1.1 Linear SVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 The dual problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Non-linear SVM . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Imperfect separation . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 The KKT conditions . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Checking KKT condition without using threshold b . . . . . . . . 7
2 SMO Algorithm 9
2.1 Optimize two α
i
’s . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 SMO Algorithm: Updating after a successful optimization step . 13
2.3 SMO Algorithm: Pick two α
i
’s for optimization . . . . . . . . . . 14
3 C
++
Implementation 15
3.1 The main routine . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 The examineExample routine . . . . . . . . . . . . . . . . . . . . 18
3.3 The takeStep routine . . . . . . . . . . . . . . . . . . . . . . . . 20
3.4 Evaluating classification function . . . . . . . . . . . . . . . . . . 24
3.5 Functions to compute dot product . . . . . . . . . . . . . . . . . 26
3.6 Kernel functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.7 Input and output . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.7.1 Get parameters by command line . . . . . . . . . . . . . . 29
3.7.2 Read in data . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.7.3 Saving and loading model parameters . . . . . . . . . . . 34
3.8 Compute error rate . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.9 Multiclass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.10 Makefiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
A The weight vectors of the parallel supporting planes 41
B The objective function of the dual problem 42
1
评论0