Train Regression Models in Regression Learner App

You can use Regression Learner to train regression models including linear regression models, regression trees, Gaussian process regression models, support vector machines, and ensembles of regression trees. In addition to training models, you can explore your data, select features, specify validation schemes, and evaluate results. You can export a model to the workspace to use the model with new data or generate MATLAB® code to learn about programmatic classification.

Training a model in Regression Learner consists of two parts:

  • Validated Model: Training a model with a validation scheme. By default, the app protects against overfitting by applying cross-validation. Alternatively, you can choose holdout validation. The validated model is visible in the app.

  • Full Model: Training a model on full data without validation. The app trains this model simultaneously with the validated model. However, the model trained on full data is not visible in the app. When you choose a regression model to export to the workspace, Regression Learner exports the full model.

The app displays the results of the validated model. Diagnostic measures, such as model accuracy, and plots, such as response plot or residuals plot reflect the validated model results. You can automatically train one or more regression models, compare validation results, and choose the best model that works for your regression problem. When you choose a model to export to the workspace, Regression Learner exports the full model. Because Regression Learner creates a model object of the full model during training, you experience no lag time when you export the model. You can use the exported model to make predictions on new data.

To get started by training a selection of model types, see Automated Regression Model Training. If you already know which regression model you want to train, see Manual Regression Model Training.

Automated Regression Model Training

You can use Regression Learner to automatically train a selection of different regression models on your data.

  • Get started by automatically training multiple models simultaneously. You can quickly try a selection of models, and then explore promising models interactively.

  • If you already know what model type you want, then you can train individual models instead. See Manual Regression Model Training.

 

  1. On the Apps tab, in the Machine Learning group, click Regression Learner.

  2. Click New Session and select data from the workspace or from file. Specify a response variable and variables to use as predictors. See Select Data and Validation for Regression Problem.

  3. On the Regression Learner tab, in the Model Type section, click the arrow to expand the list of regression models. Select All Quick-To-Train. This option trains all the model presets that are fast to fit.

  4. Click Train .

    Note

    If you have Parallel Computing Toolbox™, the app trains models in parallel. See Parallel Regression Model Training.

    A selection of model types appears in the History list. When the models finish training, the best RMSE score is highlighted in a box.

  5. Click models in the History list to explore results in the plots.

    For the next steps, see Manual Regression Model Training or Compare and Improve Regression Models.

  6. To try all the nonoptimizable model presets available, click All , and then click Train.

     

 

Manual Regression Model Training

To explore individual model types, you can train models one at a time or train a group of models of the same type.

  1. Choose a model type. On the Regression Learner tab, in the Model Type section, click a model type. To see all available model options, click the arrow in the Model Type section to expand the list of regression models. The nonoptimizable model options in the gallery are preset starting points with different settings, suitable for a range of different regression problems.

    To read descriptions of the models, switch to the details view or hover the mouse over a button to display its tooltip.

     

    For more information on each option, see Choose Regression Model Options.

  2. After selecting a model, click Train .

    Repeat to explore different models.

    Tip

    Select regression trees first. If your trained models do not predict the response accurately enough, then try other models with higher flexibility. To avoid overfitting, look for a less flexible model that provides sufficient accuracy.

  3. If you want to try all nonoptimizable models of the same or different types, then select one of the All options in the gallery.

    Alternatively, if you want to automatically tune hyperparameters of a specific model type, select the corresponding Optimizable model and perform hyperparameter optimization. For more information, see Hyperparameter Optimization in Regression Learner App.

For next steps, see Compare and Improve Regression Models.

Parallel Regression Model Training

You can train models in parallel using Regression Learner if you have Parallel Computing Toolbox. When you train models, the app automatically starts a parallel pool of workers, unless you turn off the default parallel preference Automatically create a parallel pool. If a pool is already open, the app uses it for training. Parallel training allows you to train multiple models simultaneously and continue working.

  1. The first time you click Train, you see a dialog box while the app opens a parallel pool of workers. After the pool opens, you can train multiple models at once.

  2. When models are training in parallel, you see progress indicators on each training and queued model in the History list. If you want, you can cancel individual models. During training, you can examine results and plots from models, and initiate training of more models.

To control parallel training, toggle the Use Parallel button on the app toolstrip. (The Use Parallel button is only available if you have Parallel Computing Toolbox.)

 

If you have Parallel Computing Toolbox, then parallel training is available in Regression Learner, and you do not need to set the UseParallel option of the statset function. If you turn off the parallel preference to Automatically create a parallel pool, then the app does not start a pool for you without asking first.

Note

You cannot perform hyperparameter optimization in parallel. The app disables the Use Parallel button when you select an optimizable model. If you then select a nonoptimizable model, the button is off by default.

Compare and Improve Regression Models

 

  1. Click models in the History list to explore the results in the plots. Compare model performance by inspecting results in the plots. Examine the RMSE score reported in the History list for each model. See Assess Model Performance in Regression Learner.

  2. Select the best model in the History list and then try including and excluding different features in the model. Click Feature Selection .

    Try the response plot to help you identify features to remove. See if you can improve the model by removing features with low predictive power. Specify predictors to include in the model, and train new models using the new options. Compare results among the models in the History list.

    You also can try transforming features with PCA to reduce dimensionality.

    See Feature Selection and Feature Transformation Using Regression Learner App.

  3. Improve the model further by changing model parameter settings in the Advanced dialog box. Then, train using the new options. To learn how to control model flexibility, see Choose Regression Model Options. For information on how to tune model parameter settings automatically, see Hyperparameter Optimization in Regression Learner App.

    If feature selection, PCA, or new parameter settings improve your model, try training All  model types with the new settings. See if another model type does better with the new settings.

 

Tip

To avoid overfitting, look for a less flexible model that provides sufficient accuracy. For example, look for simple models, such as regression trees that are fast and easy to interpret. If your models are not accurate enough, then try other models with higher flexibility, such as ensembles. To learn about the model flexibility, see Choose Regression Model Options.

 

This figure shows the app with a History list containing various regression model types.

Matlabsolutions.com provides guaranteed satisfaction with a commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been empanelled after extensive research and quality check.

Matlabsolutions.com provides undivided attention to each Matlab assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work done at the best price in industry.

Machine Learning in MATLAB

Train Classification Models in Classification Learner App

Train Regression Models in Regression Learner App

Distribution Plots

Explore the Random Number Generation UI

Design of Experiments

Machine Learning Models

Logistic regression

Logistic regression create generalized linear regression model - MATLAB fitglm 2

Support Vector Machines for Binary Classification

Support Vector Machines for Binary Classification 2

Support Vector Machines for Binary Classification 3

Support Vector Machines for Binary Classification 4

Support Vector Machines for Binary Classification 5

Assess Neural Network Classifier Performance

Naive Bayes Classification

ClassificationTree class

Discriminant Analysis Classification

Ensemble classifier

ClassificationTree class 2

Train Generalized Additive Model for Binary Classification

Train Generalized Additive Model for Binary Classification 2

Classification Using Nearest Neighbors

Classification Using Nearest Neighbors 2

Classification Using Nearest Neighbors 3

Classification Using Nearest Neighbors 4

Classification Using Nearest Neighbors 5

Linear Regression

Linear Regression 2

Linear Regression 3

Linear Regression 4

Nonlinear Regression

Nonlinear Regression 2

Visualizing Multivariate Data

Generalized Linear Models

Generalized Linear Models 2

RegressionTree class

RegressionTree class 2

Neural networks

Gaussian Process Regression Models

Gaussian Process Regression Models 2

Understanding Support Vector Machine Regression

Understanding Support Vector Machine Regression 2

RegressionEnsemble