Borrar filtros
Borrar filtros

K-fold cross validation

6 visualizaciones (últimos 30 días)
James Brooke
James Brooke el 31 de Mzo. de 2018
Respondida: nana rosd el 4 de Feb. de 2020
Hi, I would like to ask about "crossvalind" function in Matlab. From what I have known, k-fold validation partitioned the samples into few parts for training and training. The final estimation rate is the average of the all estimated result for each k. In the example shown, the final answer show 0.0200, may I know is that the overall estimation error rate? Thank you
if true
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
cp.ErrorRate
ans =
0.0200
end

Respuestas (1)

nana rosd
nana rosd el 4 de Feb. de 2020
can you explain, what is 'species' in your code?
if i run this code error 'Undifine variable or function species'

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by