How to make predictions with exported model from Classification Learner in App Designer?
Show older comments
Hello,
as the titel says, I am not able to make predictions with the exported model from Classification Learner in App Designer. It works fine when typing the prompts in command window, but not in app designer.
These are the prompts i used for command window:
>> load trainedModel.mat
>> imageFeatures = analyzer.getImageFeatures(47)
>> predictedLabels = trainedModel.predictFcn(imageFeatures)
and it works just fine, when trying this in app designer it doesn't work:
% this is in properties
trainedModel = load('trainedModel.mat')
% this is in button callback function
index = randomDataset.getId;
imageFeatures = app.analyzer.getImageFeatures(index);
predictedLabel = app.trainedModel.predictFcn(imageFeatures);
I get this error:
Unrecognized field name "predictFcn".
I think it doesn't load the model properly, but I don't know why or how else to load the trained model. I appreciate any help I can get.
Thanks in advance.
Accepted Answer
More Answers (1)
Drew
on 27 Feb 2023
0 votes
This question is answered at https://www.mathworks.com/matlabcentral/answers/1718885-using-a-trained-regression-model-in-app-designer
If this answers your question, please remember to accept this answer.
1 Comment
Kevin Gjoni
on 1 Mar 2023
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!