Main Content

Regression Learner

Train regression models to predict data using supervised machine learning


The Regression Learner app trains regression models to predict data. Using this app, you can explore your data, select features, specify validation schemes, train models, and assess results. You can perform automated training to search for the best regression model type, including linear regression models, regression trees, Gaussian process regression models, support vector machines, ensembles of regression trees, and neural network regression models.

Perform supervised machine learning by supplying a known set of observations of input data (predictors) and known responses. Use the observations to train a model that generates predicted responses for new input data. To use the model with new data, or to learn about programmatic regression, you can export the model to the workspace or generate MATLAB® code to recreate the trained model.

Required Products


  • Statistics and Machine Learning Toolbox™

Note: When you use Regression Learner in MATLAB Online™, you can train models in parallel using a Cloud Center cluster (requires Parallel Computing Toolbox™). For more information, see Use Parallel Computing Toolbox with Cloud Center Cluster in MATLAB Online (Parallel Computing Toolbox).

Regression Learner app

Open the Regression Learner App

  • MATLAB Toolstrip: On the Apps tab, under Machine Learning, click the app icon.

  • MATLAB command prompt: Enter regressionLearner.

Programmatic Use

expand all

regressionLearner opens the Regression Learner app or brings focus to the app if it is already open.

regressionLearner(Tbl,ResponseVarName) opens the Regression Learner app and populates the New Session from Arguments dialog box with the data contained in the table Tbl. The ResponseVarName argument, specified as a character vector or string scalar, is the name of the variable in Tbl that contains the response values. The remaining variables in Tbl are the predictor variables.

regressionLearner(Tbl,Y) opens the Regression Learner app and populates the New Session from Arguments dialog box with the predictor variables in the table Tbl and the response values in the numeric vector Y.

regressionLearner(X,Y) opens the Regression Learner app and populates the New Session from Arguments dialog box with the n-by-p predictor matrix X and the n response values in the vector Y. Each row of X corresponds to one observation, and each column corresponds to one variable. The length of Y and the number of rows of X must be equal.

regressionLearner(___,Name,Value) specifies cross-validation options using one or more of the following name-value arguments in addition to any of the input argument combinations in the previous syntaxes. For example, you can specify 'KFold',10 to use a 10-fold cross-validation scheme.

  • 'CrossVal', specified as 'on' (default) or 'off', is the cross-validation flag. If you specify 'on', then the app uses 5-fold cross-validation. If you specify 'off', then the app uses resubstitution validation.

    You can override the 'CrossVal' cross-validation setting by using the 'Holdout' or 'KFold' name-value argument. You can specify only one of these arguments at a time.

  • 'Holdout', specified as a numeric scalar in the range [0.05,0.5], is the fraction of the data used for holdout validation. The app uses the remaining data for training.

  • 'KFold', specified as a positive integer in the range [2,50], is the number of folds to use for cross-validation.


  • Regression Learner does not support model deployment to MATLAB Production Server™ in MATLAB Online.

Introduced in R2017a