我无法理解如何使用 multi-class SVM 进行 k 折交叉验证测试

I couldn't understand how to make a k-fold cross validation test with multi-class SVM

我是 matlab 和 SVM 的新手,我正在从 strach http://bioinformatics.oxfordjournals.org/content/19/13/1656.full.pdf

重现这个实验

*他们说“在 SVM 的训练中,我们使用一对一的方法 其他的,或者一个与其余的”。好的,有 12 个 类,所以他们产生 12 个 SVM。他们用正比对所有其余的训练每个 SVM。

*但后来他们说 "The prediction performance was examined by the 5-fold cross-validation test"

我的菜鸟问题是,他们怎么能在之后进行 k 折交叉验证!他们训练支持向量机。我认为(可能有问题)是当你进行 k 折交叉验证时,你从一开始就构建了一个新的支持向量机。它们可能相似,但 svm 模型在每个循环中都不同。有 k 种不同的支持向量机模型。但是,如果他们事先训练 svm 模型,他们如何进行交叉验证测试?我错过了什么?请帮忙,非常感谢

首先,他们生成交叉验证的数据集。然后他们训练 5 个模型(每个折叠一个)并反复训练测试。您可以按如下方式执行此操作:

% I assume use of LIBSVM for svm training-testing in this code snippet
% Create a random data
data=1+2*randn(1000,10);
labels=randi(12,[1000,1]);

%do 5-fold cross-validation
ind=crossvalind('Kfold',labels,5);

for i=1:5
    % (4/5)^th random data for training
    trainingData=data(ind~=5,:); %notice ~=
    trainingLabels=labels(ind~=5); 

    % (1/5)^th random data for testing
    testingData=data(ind==5,:); %notice ==
    testingLabels=labels(ind==5); 

   % train svm
    model{i,1}=svmtrain(trainingLabels,trainingData);

   %test svm
   [predLabels{i,1},accuracy(i,1)]=svmpredict(testingLabels,testingData,model{i,1});
end

% I think this is what they mean when they say, we analyze the performance
% using 5 -fold cross validation

% following two things is what you will report
plot(accuracy);  %how accuracy varies over random selection of data
avgAccuracy=mean(accuracy); %what is the average accuracy over 5 runs?