# RegressionPartitionedLinear

**Namespace: **classreg.learning.partition

**Superclasses: **`RegressionPartitionedModel`

Cross-validated linear regression model for high-dimensional data

## Description

`RegressionPartitionedLinear`

is a set of linear
regression models trained on cross-validated folds. To obtain a cross-validated, linear
regression model, use `fitrlinear`

and specify one of the
cross-validation options. You can estimate the predictive quality of the model, or how
well the linear regression model generalizes, using one or more of these
“kfold” methods: `kfoldPredict`

and `kfoldLoss`

.

Every “kfold” method uses models trained on in-fold observations to
predict the response for out-of-fold observations. For example, suppose that you
cross-validate using five folds. In this case, the software randomly assigns each
observation into five roughly equally sized groups. The *training
fold* contains four of the groups (that is, roughly 4/5 of the data) and
the *test fold* contains the other group (that is, roughly 1/5 of
the data). In this case, cross-validation proceeds as follows:

The software trains the first model (stored in

`CVMdl.Trained{1}`

) using the observations in the last four groups and reserves the observations in the first group for validation.The software trains the second model (stored in

`CVMdl.Trained{2}`

) using the observations in the first group and last three groups. The software reserves the observations in the second group for validation.The software proceeds in a similar fashion for the third through fifth models.

If you validate by calling `kfoldPredict`

, it computes predictions for
the observations in group 1 using the first model, group 2 for the second model, and so
on. In short, the software estimates a response for every observation using the model
trained without that observation.

**Note**

Unlike other cross-validated, regression models, `RegressionPartitionedLinear`

model objects do not store the predictor
data set.

## Construction

`CVMdl = fitrlinear(X,Y,Name,Value)`

creates a cross-validated,
linear regression model when `Name`

is either
`'CrossVal'`

, `'CVPartition'`

,
`'Holdout'`

, or `'KFold'`

. For more details, see
`fitrlinear`

.

## Properties

## Methods

kfoldLoss | Regression loss for observations not used in training |

kfoldPredict | Predict responses for observations not used for training |

## Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects.

## Examples

## Extended Capabilities

## Version History

**Introduced in R2016a**