Cross-validation using linear discriminant analysis
Mostra commenti meno recenti
The following code performs 10-fold cross-validation using linear discriminant analysis:
load fisheriris
indices = crossvalind('Kfold',species,10);
cp = classperf(species); % initializes the CP object
for i = 1:10
test = (indices == i); train = ~test;
class = classify(meas(test),meas(train),species(train));
% updates the CP object with the current classification results
classperf(cp,class,test)
end
cp.CorrectRate
How can this be modified to use fitcdiscr instead of classify on line 7? When I try, I get an error (Wrong number of arguments). I do not know what arguments are needed or not.
Risposte (0)
Categorie
Scopri di più su Discriminant Analysis in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!