Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Training complexity of Linear SVM

Which is the actual computational complexity of the learning phase of SVM (let's say, that implemented in LibSVM)?

Thank you

like image 658
user1923631 Avatar asked May 16 '13 10:05

user1923631


People also ask

What is the time complexity of SVM?

The results of our research has proved that the complexity of SVM (LibSVM) is O(n3) and the time complexity shown that C++ faster than Java, both in training and testing, beside that the data growth will be affect and increase the time of computation.

What is the minimum time complexity for training SVM?

6) The minimum time complexity for training an SVM is O(n2).

Why SVM takes a lot of time for training?

The most likely explanation is that you're using too many training examples for your SVM implementation. SVMs are based around a kernel function. Most implementations explicitly store this as an NxN matrix of distances between the training points to avoid computing entries over and over again.

Is SVM computationally expensive?

Both, Soft Margin and hard Margin formulation of SVM is a convex quadratic programming problem with linear constriants. Generally, used techniques for quadratic programming are very slow. Even using gradient descent is computationally expensive, here Stochastic Gradient comes into play.


2 Answers

Training complexity of nonlinear SVM is generally between O(n^2) and O(n^3) with n the amount of training instances. The following papers are good references:

  • Support Vector Machine Solvers by Bottou and Lin
  • SVM-optimization and steepest-descent line search by List and Simon

PS: If you want to use linear kernel, do not use LIBSVM. LIBSVM is a general purpose (nonlinear) SVM solver. It is not an ideal implementation for linear SVM. Instead, you should consider things like LIBLINEAR (by the same authors as LIBSVM), Pegasos or SVM^perf. These have much better training complexity for linear SVM. Training speed can be orders of magnitude better than using LIBSVM.

like image 91
Marc Claesen Avatar answered Nov 10 '22 07:11

Marc Claesen


This is going to be heavily dependent on svm type and kernel. There is a rather technical discussion http://www.csie.ntu.edu.tw/~cjlin/papers/libsvm.pdf. For a quick answer, http://www.csie.ntu.edu.tw/~cjlin/papers/libsvm.pdf, says expect it to be n^2.

like image 45
Bull Avatar answered Nov 10 '22 05:11

Bull