# RegressionPartitionedModel

Cross-validated regression model

## Description

`RegressionPartitionedModel`

is a set of
regression models trained on cross-validated folds. Estimate the quality of regression
by cross validation using one or more “kfold” methods: `kfoldPredict`

, `kfoldLoss`

, and `kfoldfun`

. Every “kfold” method uses models trained on
in-fold observations to predict response for out-of-fold observations. For example,
suppose you cross validate using five folds. In this case, every training fold contains
roughly 4/5 of the data and every test fold contains roughly 1/5 of the data. The first
model stored in `Trained{1}`

was trained on `X`

and
`Y`

with the first 1/5 excluded, the second model stored in
`Trained{2}`

was trained on `X`

and
`Y`

with the second 1/5 excluded, and so on. When you call
`kfoldPredict`

, it computes predictions for
the first 1/5 of the data using the first model, for the second 1/5 of data using the
second model and so on. In short, response for every observation is computed by
`kfoldPredict`

using the model trained
without this observation.

## Creation

### Description

You can create a `RegressionPartitionedModel`

object in two ways:

Create a cross-validated model from a regression tree model object

`RegressionTree`

by using the`crossval`

object function.Create a cross-validated model by using the

`fitrtree`

function and specifying one of the name-value arguments`CrossVal`

,`CVPartition`

,`Holdout`

,`KFold`

, or`Leaveout`

.

## Properties

## Object Functions

`gather` | Gather properties of Statistics and Machine Learning Toolbox object from GPU |

`kfoldLoss` | Loss for cross-validated partitioned regression model |

`kfoldPredict` | Predict responses for observations in cross-validated regression model |

`kfoldfun` | Cross-validate function for regression |

## Examples

## Extended Capabilities

## Version History

**Introduced in R2011a**