How can I create a standalone application using my model from Regression Learner?

1 次查看(过去 30 天)
I have created a model using the Regression Learner on Matlab and am using the GPR algorithm, I wanted to create a standalone application to predict load consumption using this model, so used the help button and it said to use this function:
function ypred = mypredict(tbl)
%#function fitrgp
load('mymodel.mat');
ypred = trainedModel.predictFcn(tbl);
end
I used this and it said that I need to specify variables to load from the file, so I changed it to:
function ypred = mypredict(tbl)
%#function fitrgp
trainedModel= load('mymodel.mat');
ypred = trainedModel.predictFcn(tbl);
end
However, now it says that I do not have enough input arguments for the
ypred= trainedModel.predictFcn(tbl)
line.
Does anyone know what I have done wrong?
Thanks!

回答(1 个)

Sean de Wolski
Sean de Wolski 2021-5-2
You need to get the data into the compiled app. Typically with compiling to an executable this would be by passing in a file name and having it read the file into a table and then write the results back to a file. Alternatively, you could put a simple user interface around it with a UI table.

类别

Help CenterFile Exchange 中查找有关 Gaussian Process Regression 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by