阅读背景:

Q: How could I use MATLAB interface for parameter selection?

来源:互联网 
Q: How could I use MATLAB interface for parameter selection? 
One can do this by a simple loop. See the following example:

bestcv = 0;
for log2c = -1:3,
  for log2g = -4:1,
    cmd = ['-v 5 -c ', num2str(2^log2c), ' -g ', num2str(2^log2g)];
    cv = svmtrain(heart_scale_label, heart_scale_inst, cmd);
    if (cv >= bestcv),
      bestcv = cv; bestc = 2^log2c; bestg = 2^log2g;
    end
    fprintf('%g %g %g (best c=%g, g=%g, rate=%g)\n', log2c, log2g, cv, bestc, bestg, bestcv);
  end
end
You may adjust the parameter range in the above loops.
Q: How could I use MATLAB interface for par



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: