基于WOA优化的libsvm最优参数计算仿真,matlab2021a测试。
[Best_score, Best_pos,~] = WOA(agent, iteration, lb, ub, dim, fobj);
cmd = ['-s 5 -t 2 ', '-c ', num2str(Best_pos(1,1)), ' -g ', ...
num2str(Best_pos(1,2)), ' -q'];
model = libsvmtrain(trainlabel, traindata, cmd);