How to make predictions with exported model from Classification Learner in App Designer?
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (1)
Drew
el 27 de Feb. de 2023
0 votos
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 comentario
Kevin Gjoni
el 1 de Mzo. de 2023
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
