To repair the error about classification
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Frisda Sianipar
am 23 Mär. 2021
Kommentiert: Star Strider
am 24 Mär. 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);
0 Kommentare
Akzeptierte Antwort
Star Strider
am 23 Mär. 2021
The ‘label’ variable must have been defined and must exist in your workspace before it is used as an argument to crossvalind.
7 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!