Reputation: 411
I'm attempting to use the multisvm function in matlab. On a small data set, everything works great. Increase the size where I need it, and I get the following error:
Error using seqminopt>seqminoptImpl (line 198) No convergence achieved within maximum number of iterations.
Error in seqminopt (line 81) [alphas offset] = seqminoptImpl(data, targetLabels, ...
Error in svmtrain (line 499) [alpha, bias] = seqminopt(training, groupIndex, ...
Error in multisvm (line 20) models(k) = svmtrain(TrainingSet,G1vAll);
I've been trying to look for a solution online and found this: http://www.mathworks.com/matlabcentral/answers/66183,
where the advice is "so increase the maximum number of iterations". The problem is, this doesn't seem to be easy to do. I am somewhat of a novice, but am trying to figure this out on my own by looking through all these files, without success. Does anyone know how I can increase the number of iterations and solve this problem?
Upvotes: 0
Views: 6002
Reputation: 486
Svmtrain is trying to find a correct line between e.g. two groups. If it doesn't find correct line, it change some parameters in function of line to find a correct line which separated groups and make an iteration of the iteration parameter. By default it is trying to find a correct line 15000 times. If we use following code, svmtrain will try 100000 times to find a corrected line. But the time of training is naturally longer.
options.MaxIter = 100000;
my_svm_struct = svmtrain((Training, Group, 'Options', options);
Upvotes: 4
Reputation: 17026
You can do this using the optional 'options'
parameter of the svmtrain
function (MaxIter
). The documentation of svmtrain contains more information about this.
You will need to make the options struct with either statset
if you're using SMO (default) or optimset
if you're using the QP solver.
Upvotes: 2