After installing libsvm in MATLAB, enter svmpredict and you can see that its usage is as follows:
Usage: [predicted_label, accuracy, decision_values/prob_estimates] = svmpredict(testing_label_vector, testing_instance_matrix, model, 'libsvm_options')
[predicted_label] = svmpredict(testing_label_vector, testing_instance_matrix, model, 'libsvm_options')
Parameters:
model: SVM model structure from svmtrain.
libsvm_options:
-b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); one-class SVM not supported yet
-q : quiet mode (no outputs)
Returns:
predicted_label: SVM prediction output vector.
accuracy: a vector with accuracy, mean squared error, squared correlation coefficient.
prob_estimates: If selected, probability estimate vector.
Where'libsvm_options' is a string, if it is'-q', it means quiet mode
If you do not add'-q', after running svmpredict normally, Accuracy and other information will be printed on the console, but if you add'-q', these messy things will not be printed, and directly return [predicted_label], or Returns [predicted_label, accuracy, decision_values/prob_estimates]
If you bring it, write it as:
[a1, a2, a3] = svmpredict(a4, a5, a6, a7)
It will return [predicted_label, accuracy, decision_values / prob_estimates ] these three quantities
if written as:
[a1] = svmpredict(a4, a5, a6, a7)
Just return predicted_label
if written as:
[a1, a2] = svmpredict(a4, a5, a6, a7)
If the parameters do not match, the svmpredict operation will not be executed, and it will print out the instructions for using svmpredict on the console.