I have a set of data that I am trying to learn using SVM. For context, the data has a dimensionality of 35 and contains approximately 30'000 data-points.
I have previously trained decision trees in Matlab with this dataset and it took approximately 20 seconds. Not being totally satisfied with the error rate, I decided to try SVM.
I first tried svmtrain(X,Y)
. After about 5 seconds, I get the following message:
??? Error using ==> svmtrain at 453 Error calculating the kernel function: Out of memory. Type HELP MEMORY for your options.
When I looked up this error, it was suggested to me that I use the SMO method: svmtrain(X, Y, 'method', 'SMO');
. After about a minute, I get this:
??? Error using ==> seqminopt>seqminoptImpl at 236 No convergence achieved within maximum number (15000) of main loop passes
Error in ==> seqminopt at 100 [alphas offset] = seqminoptImpl(data, targetLabels, ...
Error in ==> svmtrain at 437 [alpha bias] = seqminopt(training, groupIndex, ...
I tried using the other methods (LS and QP), but I get the first behaviour again: 5 second delay then
??? Error using ==> svmtrain at 453 Error calculating the kernel function: Out of memory. Type HELP MEMORY for your options.
I'm starting to think that I'm doing something wrong because decision trees were so effortless to use and here I'm getting stuck on what seems like a very simple operation.
Your help is greatly appreciated.
Did you read the remarks near the end about the algorithm memory usage?
Try setting the method to
SMO
and use akernelcachelimit
value that is appropriate to the memory you have available on your machine.During learning, the algorithm will build a double matrix of size
kernelcachelimit-by-kernelcachelimit
. default value is 5000Otherwise subsample your instances and use techniques like cross-validation to measure the performance of the classifier.
Here is the relevant section: