To repair the error about classification

1 visualización (últimos 30 días)
Frisda Sianipar
Frisda Sianipar el 23 de Mzo. de 2021
Comentada: Star Strider el 24 de Mzo. de 2021
indices = crossvalind('Kfold',label,5);
cp=classperf(label);
for i = 1:5
test = (indices == i); train = ~test;
class =knnclassify(dim(test,:),dim(train,:),label(train,:),5,'euclidean', 'nearest');
classperf(cp,class,test)
end
cp.ErrorRate
The error:
Undefined function or variable 'label'.
Error in knn (line 1)
indices = crossvalind('Kfold',label,5);

Respuesta aceptada

Star Strider
Star Strider el 23 de Mzo. de 2021
The ‘label’ variable must have been defined and must exist in your workspace before it is used as an argument to crossvalind.
  7 comentarios
Frisda Sianipar
Frisda Sianipar el 24 de Mzo. de 2021
I want to randomly share the data using the code using k-fold cross validation
Star Strider
Star Strider el 24 de Mzo. de 2021
I do not understand.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by