0
votes

I have a problem with probability estimate for multi-class classification in libsvm. I have 5 labels from 0 to 4 and svmpredict return a matrix 'prob_estimates' 985x10, where 985 is the number of test set and 10 should be the number of the label. I think there's a mistake because i have 5 labels but i don't understand why and what i can do to solve the problem.

The code is this:

model = svmtrain(train_label, train, ['-c ' num2str(best_C) ' -g ' num2str(best_gamma) ' -b 1']); [predict_label, accuracy, prob_estimates] = svmpredict(test_label, test, model);

"test_label" is a matrix 985x1 with numbers from 0 to 4.
"test" is a feature matrix 985x1987.

Can someone help me? Thank you.

1

1 Answers

0
votes

problem solved:
I changed the code like following:

model = svmtrain(train_label, train, ['-c ' num2str(best_C) ' -g ' num2str(best_gamma) ' -b 1']); [predict_label, accuracy, prob_estimates] = svmpredict(test_label, test, model, '-b 1 -q');

I added in svmpredict this parameters: '-b 1 -q'.