Main Content

**Class: **TreeBagger

Quantile loss using bag of regression trees

returns
half of the mean absolute deviation (MAD) from comparing the true
responses in the table `err`

= quantileError(`Mdl`

,`X`

)`X`

to the predicted medians
resulting from applying the bag of regression trees `Mdl`

to
the observations of the predictor data in `X`

.

`Mdl`

must be a`TreeBagger`

model object.The response variable name in

`X`

must have the same name as the response variable in the table containing the training data.

uses
the true response and predictor variables contained in the table `err`

= quantileError(`Mdl`

,`X`

,`ResponseVarName`

)`X`

. `ResponseVarName`

is
the name of the response variable and `Mdl.PredictorNames`

contain
the names of the predictor variables.

uses
any of the previous syntaxes and additional options specified by one
or more `err`

= quantileError(___,`Name,Value`

)`Name,Value`

pair arguments. For example,
specify quantile probabilities, the error type, or which trees to
include in the quantile-regression-error estimation.

To tune the number of trees in the ensemble, set

`'Mode','cumulative'`

and plot the quantile regression errors with respect to tree indices. The maximal number of required trees is the tree index where the quantile regression error appears to level off.To investigate the performance of a model when the training sample is small, use

`oobQuantileError`

instead.

[1] Breiman, L. *Random Forests.* Machine
Learning 45, pp. 5–32, 2001.

[2] Meinshausen, N. “Quantile Regression
Forests.” *Journal of Machine Learning Research*,
Vol. 7, 2006, pp. 983–999.