MATLAB Answers

How to optimize machine-learning model exported from regression learner app?

8 ビュー (過去 30 日間)
Manhee 2020 年 8 月 10 日
回答済み: Anshika Chaurasia 2020 年 8 月 13 日
Thank you for visiting this question.
Now I've tried to optimize my machine-learning model exported from regression learner app.
This model has 27 inputs, and there is no certain numerical equation for result.
I googled keywords such as optimization of trained model, or optimization using GAMS, but I've failed to find proper items.
Please help me !

  0 件のコメント



Anshika Chaurasia
Anshika Chaurasia 2020 年 8 月 13 日
Hi Manhee,
After exporting the model from Regression Learner App, a structure variable is exported to workspace using it prediction on the test dataset can be done.
There are two possible ways to optimize:
  • Optimization can be done in MATLAB script after using Generate Function under Export. This will generate MATLAB script containing trainRegressionModel function as shown below:
% [trainedModel, validationRMSE] = trainRegressionModel(trainingData)
% Returns a trained regression model and its RMSE. This code recreates the
% model trained in Regression Learner app.
% Input:
% trainingData: A table containing the same predictor and response
% columns as those imported into the app.
% Output:
% trainedModel: A struct containing the trained regression model. The
% struct contains various fields with information about the trained
% model.
% For example, to retrain a regression model trained with the original data
% set T, enter:
% [trainedModel, validationRMSE] = trainRegressionModel(T)
% To make predictions with the returned 'trainedModel' on new data T2, use
% yfit = trainedModel.predictFcn(T2)
The trainRegressionModel function has fit function which can be modified to optimize the model. Refer to Bayesian Optimization Workflow documentation (section - Parameters Available for Fit Functions) for more information related to different kind of fit functions.

  0 件のコメント


その他の回答 (0 件)


Community Treasure Hunt

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

Start Hunting!

Translated by