RegressionPartitionedEnsemble
statistics: RegressionPartitionedEnsemble
Cross-validated ensemble of regression trees
A RegressionPartitionedEnsemble object holds one ensemble per fold
of a partition, each fitted on the observations the fold keeps for
training, and predicts every observation with the ensemble of the fold
that held it out.
Create one with fitrensemble given a cross-validation option, or
with the crossval method of a RegressionEnsemble or
RegressionBaggedEnsemble.
See also: fitrensemble, RegressionEnsemble.crossval, CompactRegressionEnsemble, cvpartition
Source Code: RegressionPartitionedEnsemble
The RegressionPartitionedEnsemble class contains the following properties:
A column cell array with one RegressionEnsemble or
RegressionBaggedEnsemble per fold, which resume grows.
This property is read-only.
A row vector. This property is read-only.
'LSBoost' or 'Bag'. This property is read-only.
This property is read-only.
Always empty. This property is read-only.
This property is read-only.
This property is read-only.
This property is read-only.
This property is read-only.
The weights of the ensemble that was cross-validated, by which the losses weigh the held-out observations. This property is read-only.
A structure with the fields Type, Method,
'PartitionedEnsemble', LearnerTemplates, the
ModelParameters of the ensemble the folds were fitted as, and
NLearn, the number of folds. This property is read-only.
A column cell array with one CompactRegressionEnsemble per fold.
This property is read-only.
This property is read-only.
A cvpartition object. This property is read-only.
Always empty. This property is read-only.
The folds carry none; this one is applied once to what they predict. MATLAB R2024a leaves the transform on the folds as well and so applies it twice.
The RegressionPartitionedEnsemble class offers the following public methods:
RegressionPartitionedEnsemble: yfit = kfoldPredict (obj)
yfit holds each observation’s prediction from the ensemble of the
fold that held it out, after ResponseTransform, and NaN
for an observation no fold held out.
See also: RegressionPartitionedEnsemble, RegressionPartitionedEnsemble.kfoldLoss
RegressionPartitionedEnsemble: L = kfoldLoss (obj)
RegressionPartitionedEnsemble: L = kfoldLoss (…, name, value)
L is the weighted mean squared error of the out-of-fold
predictions, the held-out observations weighted by W.
Name-Value arguments:
| Name | Value | |
|---|---|---|
'Folds' | The folds to use, pooled. The default is all of them. | |
'LossFun' | 'mse' (default) or a function
handle called as lossfun (Y, Yfit, W) with normalized weights. | |
'Mode' | 'average' (default) for one loss
over the observations of every fold used, 'individual' for a
column with the loss of each fold, or 'cumulative' for a column
whose element t uses the first t trees of every fold. |
See also: RegressionPartitionedEnsemble, RegressionPartitionedEnsemble.kfoldPredict
RegressionPartitionedEnsemble: vals = kfoldfun (obj, fun)
fun is called once per fold as
fun (CMP, Xtrain, Ytrain, Wtrain, Xtest, Ytest, Wtest),
CMP being the fold’s compact ensemble and the weights those of
W, and must return a row. vals stacks the rows.
See also: RegressionPartitionedEnsemble
RegressionPartitionedEnsemble: CVMdl = resume (obj, NumLearningCycles)
RegressionPartitionedEnsemble: CVMdl = resume (…, ’NPrint’, n)
Each fold’s ensemble is resumed, as RegressionEnsemble.resume
does, by NumLearningCycles trees.
See also: RegressionPartitionedEnsemble, RegressionEnsemble.resume