# libsvm training very slow on 100K rows, suggestions?

I'm trying to run the libsvm-provided wrapper script easy.py on a training set of 100K rows, each row has ~300 features. The feature data is relatively sparse, say only 1/10th are non-zero values.

The script is excruciatingly slow, I'm talking days (or more). I ran the same script on 1% of the data, and it finished in about 20 minutes, with some reasonable looking results, so it looks like the input data / format is correct and there are no obvious issues with it.

I found the documentation for libsvm to be somewhat lacking and not very helpful on practical issues like performance. Their FAQ is silent on these matters: http://www.csie.ntu.edu.tw/~cjlin/libsvm/faq.html

Has anyone experienced similar issues with SVM training speed? Do you know of more suitable libraries or specific strategies to try out in such cases?

• If the complexity is indeed $O(n^3)$, then you should expect the full dataset to take $10^6 \times 20 \, min \approx$ 40 years. So it looks like your method is doing not so badly after all. – Hans Engler Aug 27 '11 at 21:58
• I removed the part about n^3 because I'm not sure about that, and you're right, the 20 mins would translate to years in that case. I can't be the first person trying to train SVMs on 100K rows though, right? – user6020 Aug 28 '11 at 0:23
• n^3 is wrong. For a general kernel the complexity is in pn^2. For linear kernels it can be sup linear. – user603 Aug 29 '11 at 7:15
• If you are not going to use kernel then switch to liblinear. It is amazingly much faster than libsvm. – user49428 Jul 3 '14 at 9:05