samedi 17 février 2018

Matlab Classification KNN - Predict labels for new data

How to predict labels for new data (test set) by the KNN model in Matlab? This is a part of my code: cvmodel=fitcknn(training_data,class1, 'Distance',@mindistnew, 'NumNeighbors',1, 'KFold',10); cvclass=predict(cvmodel, testing_data);

When I run this on matlab I got this error msg:

Error using predict (line 84) Systems of classreg.learning.partition.ClassificationPartitionedModel class cannot be used with the "predict" command. Convert the system to an identified model first, such as by using the "idss" command.

Error in SAX_IP_G_ALL_Best_CV85 (line 23) cvclass=predict(cvmodel, testing_Best);

Aucun commentaire:

Enregistrer un commentaire