Obtain standard deviation for libsvm
I have the following code for Grid search, but it only return the accuracy result using 5 folds cross-validation. Is it possible to obtain standard deviation from the 5 folds CV. How would you do that? Thanks in advance.
for i=1:numLog2c
log2c = log2c_list(i);
for j=1:numLog2g
log2g = log2g_list(j);
cmd = ['-q -v ', int2str(nFold), ' -c ', num2str(2^log2c), ' -g ', num2str(2^log2g),' ', svmCmd];
cv = svmtrain(trainLabel, trainData, cmd);
cvMatrix(i,j) = cv;
if(cv = bestcv)
bestcv= cv; bestLog2c = log2c; bestLog2g = log2g;
end
fprintf('(%g, %g) %g (best c=%g, g=%g, Rate=%g)\n', log2c, log2g, cv, bestLog2c, bestLog2g, bestcv);
end
end
disp(['CV scale1: best log2c:',num2str(bestLog2c),' best log2g:',num2str(bestLog2g),' cv-accuracy:',num2str(bestcv),'%']);
Topic cross-validation r libsvm
Category Data Science