How to optimize the hyperparameter for support vector regression with LIBSVM library on MATLAB?

1 view (last 30 days)
To make a regression model using LIBSVM library on MATLAB? Therefore paraameter of optimization is required. I optimized parameter but it's not working because epsilon does not change with other parameter?
my loop for optimization is such as
bestcv = inf;
for log2c = -1:10
for log2g = -1:5
for log2p = -10:-7
cmd = [ '-v 5 -s 3 ', '-c ', num2str(2^log2c), ' -g ', num2str(2^log2g), '-p', num2str(2^log2p)];
cv = svmtrain(Y, X, cmd);
if (cv<= bestcv)
bestcv = cv; bestc = 2^log2c; bestg = 2^log2g; bestp = 2^log2p;
end
fprintf('%g %g %g %g(best c=%g, g=%g, p=%p rate=%g)\n', log2c, log2g, log2p, cv, bestc, bestg, bestp, bestcv);
end
end
end
How to change in the loop and get correct values? please explain it
Thanks in advance

Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!