How to make predictions with exported model from Classification Learner in App Designer?
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Drew
am 27 Feb. 2023
0 Stimmen
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 Kommentar
Kevin Gjoni
am 1 Mär. 2023
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
