LIBSVM:svmpredict函数quiet mode是什么意思?

在MATLAB中安装好libsvm之后,输入svmpredict就可以看到,其使用方法如下所示:

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.

其中’libsvm_options’是一个字符串,如果是’-q’,则表示quiet模式

如果不加’-q’,正常运行svmpredict之后就会在控制台上打印出Accuracy等信息,但是如果加了’-q’,就不会打印出这些乱七八糟的东西,直接返回[predicted_label],或者返回[predicted_label, accuracy, decision_values/prob_estimates]

如果带啊写成:

[a1, a2, a3] = svmpredict(a4, a5, a6, a7)

那么就会返回[predicted_label, accuracy, decision_values/prob_estimates]这三个量
如果写成:

[a1] = svmpredict(a4, a5, a6, a7)

就只返回predicted_label
如果写成:

[a1, a2] = svmpredict(a4, a5, a6, a7)

就会发生参数不匹配,就不会执行svmpredict操作,它会在控制台上打印出svmpredict的使用说明

你可能感兴趣的:(支持向量机)