Regression Learner - Neural Network results not reproducible

2 次查看(过去 30 天)
I am looking for help to set the random seed to get reproducible results while using the Matlab Online version for Apps - Regression Learner - All Neural Networks models.
Thanks in advance.
  2 个评论
Christopher McCausland
Hi Hussain,
Once you have an idea of the module generated with the regression learner app, you can export the code with the "Export model" button.
In order to set a repeateable seed, you can use the rng() fucntion at the start of your exported code.
rng('default') %% Or give a seed of you choice
Hope this helps,
Christopher
Hussain Ali
Hussain Ali 2023-12-3
Thanks Chrsitopher for the timely support. When I export model, it stores as trainedmodel in workspace as '1x1 struct'. I am unable to locate the code, if you could help me.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2023-12-3
When you export the model "trainedModel" to the workspace, you then have to save it in a .mat file so that you can recall it for use later in your program:
In the command window:
save('trainedModel.mat', 'trainedModel');
Then in your code where you want to use the model, you use load to recall the model from the mat file on disk
s = load('trainedModel.mat');
trainedModel = s.trainedModel;

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by