0
我正在寻找训练我的支持向量机分类器的C(成本参数)的最佳值。这里是我的代码:训练支持向量机分类器时Wierd behaviors
clear all; close all; clc
% Load training features and labels
[y, x] = libsvmread('training_data.train'); %the training dataset is named training_data.train
cost=[2^-7,2^-5,2^-3,2^-1,2^1,2^3,2^5,2^7,2^9,2^11,2^13,2^15];
accuracy=zeros(1,length(cost)); %This array will store the accuracy values corresponding to each element in the cost array
for i = 1:length(cost)
opt = sprintf('-c %i -v 3',cost(i));
accuracy(i)=svmtrain(y,x,opt);
end
accuracy
我正在使用LIBSVM库。当运行该程序,精度阵列被填充有很奇怪的值: 这里是输出:
列1到8:
67.335 93.696 91.404 92.550 93.696 93.553 93.553 93.553
列9通过12:
93.553 93.553 93.553 93.553
这意味着我得到2 ^最高的交叉验证准确性-5。我应该获得最高C值的最高精度吗? (据我了解,这是错误分类的惩罚因素)。这种行为是否期望它? (我正在使用UCI ML数据库构建乳腺癌鉴定分类器)。
感谢您的回答。我是Stack Overflow的新手,因此我无法对您的答案赞不绝口。但是它有帮助。 –
@PrashantPandey如果它回答你的问题,你应该*接受*他的回答(尽管有SO分数,这应该总是可能的)。 – sascha
做到了。谢谢你的提示。 –