Setting the number of Maximum iterations in MATLAB
I want to know how I can set the 开发者_C百科number of Maximum Iterations(want to increase it) in MATLAB. Does anybody knows?
I am using svmtrain
you can pass options using either the 'SMO_OPTS' or the 'QUADPROG_OPTS' flags depending on which method you are using
SVMTRAIN(...,'QUADPROG_OPTS',OPTIONS)
or
SVMTRAIN(...,'SMO_OPTS',SMO_OPTIONS)
to create QP options, use optimset, to create SMO_OPTS, use svmsmoset. either way, it's the maxiter field that you want to change.
doc svmsmoset
OPTIONS = SVMSMOSET('NAME1',VALUE1,'NAME2',VALUE2,...)
MaxIter
Maximum number of iterations of main loop. If this number is exceeded before the algorithm converges then the algorithm stops and gives an error. Default value is 15000.
By the way, help svmtrain or doc svmtrain contains all this info
Try setting your options struct, using "statset" eg
options = statset('maxIter',45000);
svmStruct = svmtrain(TrainingMat,Labels,'kernel_function', 'linear','options',options);
精彩评论