App Designer for Classification

I have trained and tested a set of data with the RUSBoosted Tree ensemble based algorithm in classification learner.
However, I would like to apply the classification function in the App designer.
May I get some recommended ideas on how to do so?

Respuestas (1)

Image Analyst
Image Analyst el 28 de Jun. de 2022

0 votos

In the learner, export the model to a .mat file. Then in your app read in the mat file and call it like the mat file tells you to.

5 comentarios

Haw Jia Yong
Haw Jia Yong el 28 de Jun. de 2022
Thank you for your reply.
I had exported my model into .mat file and load into the app learner.
But how should I call the mat file to make the prediction?
I have 7 numeric data as input and 3 different output variables.
% Button pushed function: PredictButton
function PredictButtonPushed(app, event)
Classification=load('ClassificationLearnerSession1.mat');
Hydrogen=app.HydrogenEditField.Value;
Ethane=app.AcetyleneEditField.Value;
Dioxide=app.CarbonDioxideEditField.Value;
Monoxide=app.CarbonMonoxideEditField.Value;
Acetylene=app.AcetyleneEditField.Value;
Ethylene=app.EthyleneEditField.Value;
Methane=app.MethaneEditField.Value;
You forgot to attach your exported mat file. When you read it in, it will tell you how to call it
Classification=load('ClassificationLearnerSession1.mat') % No semicolon!!!
Then look in the command window. One of the fields of s should be a string telling you how to call it.
Haw Jia Yong
Haw Jia Yong el 28 de Jun. de 2022
From the command window, I was asked to call by struct,
But how to allow my app.outputEditField to get the prediction output (conditionA, conditionB and conditionC) based on the input ?
Classification = struct('Hydrogen',Hydrogen, ...
'Ethane',Ethane, ...
'Dioxide',Dioxide, ...
'Monoxide',Monoxide, ...
'Acetylene',Acetylene, ...
'Ethylene',Ethylene, ...
'Methane',Methane)
Image Analyst
Image Analyst el 28 de Jun. de 2022
You forgot to attach the model in the .mat file again. And you also forgot to attach your .mlapp file. I'll check back later.
Haw Jia Yong
Haw Jia Yong el 28 de Jun. de 2022
My current .mat file and .mlapp for your advice.

Iniciar sesión para comentar.

Preguntada:

el 28 de Jun. de 2022

Comentada:

el 28 de Jun. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by