For the first example of "crossvalind" function in the
bioinformatics toolbox:
% Create a 10-fold cross-validation to compute
classification error.
load fisheriris
indices = crossvalind('Kfold',species,10);
cp = classperf(species);
for i = 1:10
test = (indices == i); train = ~test;
class =
classify(meas(test,:),meas(train,:),species(train,:));
classperf(cp,class,test)
end
Is the output of cp.CorrectRate the average of the 10-fold
cross validation or only the CorrectRate of the last fold?
If it is the avearage of the ten folds, I suggest to add one
more property of cp, that is, "the variance of the
CorrectRate". Only Mean and variance together would make a
statistical significance
haibuo1981@gmail.com - 30 Jul 2008 07:45 GMT
Excuse me.
I can not reply your question because I'm a fresher of Matlab.
I tried to use crossvalind function, but I get a "Undefined command/
function 'crossvalind'" question.
My test code was a copy of Bioinformation Toolbox example:
load carbig
x = Displacement; y = Acceleration;
N = length(x);
sse = 0;
for i = 1:100
[train,test] = crossvalind('LeaveMOut',N,1);
yhat = polyval(polyfit(x(train),y(train),2),x(test));
sse = sse + sum((yhat - y(test)).^2);
end
CVerr = sse / 100
My Matlab Version is 7.0.1, and I added bioinfo folders in my path.
Can you help me?
Any advice is welcoming...