首页 > 其他 > 详细

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

时间:2015-11-24 06:15:55      阅读:251      评论:0      收藏:0      [点我收藏+]
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.

  http://www.csie.ntu.edu.tw/~cjlin/libsvm/faq.html

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

原文:http://www.cnblogs.com/huadongw/p/4990414.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!