Selecting SVM parameters using cross validation and F1-scores
问题 I need to keep track of the F1-scores while tuning C & Sigma in SVM, For example the following code keeps track of the Accuracy, I need to change it to F1-Score but I was not able to do that……. %# read some training data [labels,data] = libsvmread('./heart_scale'); %# grid of parameters folds = 5; [C,gamma] = meshgrid(-5:2:15, -15:2:3); %# grid search, and cross-validation cv_acc = zeros(numel(C),1); for i=1:numel(C) cv_acc(i) = svmtrain(labels, data, ... sprintf('-c %f -g %f -v %d', 2^C(i),