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

1 回表示 (過去 30 日間)
Natalie Dunne
Natalie Dunne 2021 年 5 月 2 日
回答済み: Sean de Wolski 2021 年 5 月 2 日
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 Center および File ExchangeGaussian Process Regression についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by