How to use a trained kNN model from Classification APP NEW DATA.
Show older comments
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)
Aditya Patil
on 15 Jul 2020
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
Categories
Find more on Nearest Neighbors in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!