selectModels
Class: RegressionLinear
Select fitted regularized linear regression models
Description
Input Arguments
Output Arguments
Examples
Tips
One way to build several predictive linear regression models is:
Hold out a portion of the data for testing.
Train a linear regression model using
fitrlinear
. Specify a grid of regularization strengths using the'
Lambda
'
name-value pair argument and supply the training data.fitrlinear
returns oneRegressionLinear
model object, but it contains a model for each regularization strength.To determine the quality of each regularized model, pass the returned model object and the held-out data to, for example,
loss
.Identify the indices (
idx
) of a satisfactory subset of regularized models, and then pass the returned model and the indices toselectModels
.selectModels
returns oneRegressionLinear
model object, but it containsnumel(idx)
regularized models.To predict class labels for new data, pass the data and the subset of regularized models to
predict
.