Superclasses: RegressionPartitionedModel
Crossvalidated regression ensemble
RegressionPartitionedEnsemble
is a set of regression
ensembles trained on crossvalidated folds. Estimate the quality of
classification by cross validation using one or more "kfold"
methods: kfoldfun
, kfoldLoss
,
or kfoldPredict
. Every "kfold"
method uses models trained on infold observations to predict response
for outoffold 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.
creates a crossvalidated
ensemble from cvens
=
crossval(ens
)ens
, a regression ensemble. For syntax
details, see the crossval
method reference page.
creates
a crossvalidated ensemble when cvens
= fitensemble(X,Y,method,nlearn,learners,name,value)name
is one of 'crossval'
, 'kfold'
, 'holdout'
, 'leaveout'
,
or 'cvpartition'
. For syntax details, see the fitensemble
function reference page.

A regression ensemble constructed with 

List of categorical predictors. 

Name of the crossvalidated model, a string. 

Number of folds used in a crossvalidated tree, a positive integer. 

Object holding parameters of 

Numeric scalar containing the number of observations in the training data. 

Vector of 

The partition of class 

A cell array of names for the predictor variables, in the order
in which they appear in 

Name of the response variable 

Function handle for transforming scores, or string representing
a builtin transformation function. Add or change a ens.ResponseTransform = @function 

Cell array of ensembles trained on crossvalidation folds. Every ensemble is full, meaning it contains its training data and weights. 

Cell array of compact ensembles trained on crossvalidation folds. 

The scaled 

A matrix of predictor values. Each column of 

A numeric column vector with the same number of rows as 
kfoldLoss  Crossvalidation loss of partitioned regression ensemble 
resume  Resume training ensemble 
kfoldfun  Cross validate function 
kfoldLoss  Crossvalidation loss of partitioned regression model 
kfoldPredict  Predict response for observations not used for training. 
Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB^{®} documentation.
Construct a partitioned regression ensemble, and examine the crossvalidation losses for the folds:
load carsmall XX = [Cylinders Displacement Horsepower Weight]; YY = MPG; rens = fitensemble(XX,YY,'LSBoost',100,'Tree'); cvrens = crossval(rens); L = kfoldLoss(cvrens,'mode','individual') L = 42.4468 12.3158 65.9432 39.0019 30.5908 16.6225 17.3071 46.1769 8.0561 12.9689