以下摘自libsvm-mat-2.86-1中的readme的文档
Examples
========
Train and test on the provided data heart_scale:
matlab> load heart_scale.mat
matlab> model = svmtrain(heart_scale_label, heart_scale_inst, '-c 1 -g 0.07');
matlab> [predict_label, accuracy, dec_values] = svmpredict(heart_scale_label, heart_scale_inst, model); % test the training data

运行结果
Accuracy = 86.6667% (234/270) (classification)

试想我是用heart_scale.mat中的数据来进行训练svmtrain,然后同样使用heart_scale.mat中相同的数据进行预测分类,结果应该是100%才对,为什么是86%呢

同样,我使用
a=[1 -1]
b=[0.1 0.2;0.3 0.4]
model = svmtrain(a', b, '-c 1 -g 0.07')
[predict_label, accuracy, dec_values] = svmpredict(a', b, model)
运行结果
Accuracy = 100% (2/2) (classification)

预测结果是100%