MATLAB Answers

0

what command to predict class of test data using created KNNclassification model?

Asked by pavan sunder on 30 Oct 2016
Latest activity Answered by reem aldaihani on 17 Feb 2018
i have a [1x1000] training vector and a categorical response variable resp;
ihave created KNNclassification model using the following code:
mdl = fitcknn(p,resp,'NumNeighbors',k,'distance','euclidean','kfold',5,'standardize',1);
i want to predict the class for the for each element of [1x1000] test vector t
i used the command:
y=predict(mdl,t)
its giving error:
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.
plz tell me how to solve this? which is the matlab command to achieve this?

  0 Comments

Sign in to comment.

1 Answer

Answer by reem aldaihani on 17 Feb 2018

I got the same error and I don't know the answer. Hope someone can help us.

  0 Comments

Sign in to comment.