# RegressionBaggedEnsemble

Regression ensemble grown by resampling

## Description

`RegressionBaggedEnsemble`

combines a set of
trained weak learner models and data on which these learners were trained. It can
predict ensemble response for new data by aggregating predictions from its weak
learners.

## Creation

### Description

Create a bagged regression ensemble object using `fitrensemble`

. Set the name-value pair argument
`'Method'`

of `fitrensemble`

to
`'Bag'`

to use bootstrap aggregation (bagging, for example,
random forest).

For a description of bagged classification ensembles, see Bootstrap Aggregation (Bagging) and Random Forest.

## Properties

## Object Functions

`compact` | Reduce size of regression ensemble model |

`crossval` | Cross-validate machine learning model |

`cvshrink` | Cross-validate pruning and regularization of regression ensemble |

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

`lime` | Local interpretable model-agnostic explanations (LIME) |

`loss` | Regression error for regression ensemble model |

`oobLoss` | Out-of-bag error for bagged regression ensemble model |

`oobPermutedPredictorImportance` | Out-of-bag predictor importance estimates for random forest of regression trees by permutation |

`oobPredict` | Predict out-of-bag responses of bagged regression ensemble |

`partialDependence` | Compute partial dependence |

`plotPartialDependence` | Create partial dependence plot (PDP) and individual conditional expectation (ICE) plots |

`predict` | Predict responses using regression ensemble model |

`predictorImportance` | Estimates of predictor importance for regression ensemble of decision trees |

`regularize` | Find optimal weights for learners in regression ensemble |

`removeLearners` | Remove members of compact regression ensemble |

`resubLoss` | Resubstitution loss for regression ensemble model |

`resubPredict` | Predict response of regression ensemble by resubstitution |

`resume` | Resume training of regression ensemble model |

`shapley` | Shapley values |

`shrink` | Prune regression ensemble |

## Examples

## Tips

For a bagged ensemble of regression trees, the `Trained`

property
of `ens`

stores a cell vector of `ens.NumTrained`

`CompactRegressionTree`

model objects. For a textual or graphical display of
tree * t* in the cell vector,
enter

view(ens.Trained{t})

## Alternative Functionality

### Bootstrap Aggregation Methods

For classification or regression, you can choose two approaches for bagging:

Classification: create a bagged ensemble using

`fitcensemble`

or`TreeBagger`

.Regression: create a bagged ensemble using

`fitrensemble`

or`TreeBagger`

.

For help choosing between these approaches, see Ensemble Algorithms and Suggestions for Choosing an Appropriate Ensemble Algorithm.

## Extended Capabilities

## Version History

**Introduced in R2011a**