How to use a trained kNN model from Classification APP NEW DATA.

Hi, I have a trained KNN modelf from the classifcation app, and I'm trying to use it on a new data (a table).
The yfit function does not work and neither does this:
kNNMdl= trainedModel1.ClassificationKNN;
[lables]= predict(kNNMdl,ApneaUntrained);
I'm not sure what I'm doing please help.

Answers (1)

Once you export the model to workspace, you can predict on new data as follows,
y = trainedModel.predictFcn(X); %where X is new data, and y is output

Products

Asked:

on 4 May 2020

Answered:

on 15 Jul 2020

Community Treasure Hunt

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

Start Hunting!