Categories &

Functions List

Class Definition: ClassificationPartitionedEnsemble

statistics: ClassificationPartitionedEnsemble

Cross-validated ensemble of decision trees for classification

A ClassificationPartitionedEnsemble object holds one ensemble per fold of a partition, each fitted on the observations the fold keeps for training, and answers for every observation with the ensemble of the fold that held it out.

Create one with fitcensemble given a cross-validation option, or with the crossval method of a ClassificationEnsemble or ClassificationBaggedEnsemble.

See also: fitcensemble, ClassificationEnsemble.crossval, CompactClassificationEnsemble, cvpartition

Source Code: ClassificationPartitionedEnsemble

The ClassificationPartitionedEnsemble class contains the following properties:

A column cell array with one ClassificationEnsemble or ClassificationBaggedEnsemble per fold, which resume grows. This property is read-only.

A row vector. This property is read-only.

The Method of the ensemble, such as 'AdaBoostM1' 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. The losses and edges weigh the held-out observations by them. 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 CompactClassificationEnsemble 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.

This property is read-only.

This property is read-only.

This property is read-only.

The folds carry none; this one is applied once to the scores they return.

The ClassificationPartitionedEnsemble class offers the following public methods:

ClassificationPartitionedEnsemble: label = kfoldPredict (obj)
ClassificationPartitionedEnsemble: [label, scores] = kfoldPredict (obj)

scores holds each observation’s scores from the ensemble of the fold that held it out, after ScoreTransform, and label the class of highest score. An observation no fold held out, as under a holdout partition, has NaN scores and the class of greatest prior probability.

See also: ClassificationPartitionedEnsemble, ClassificationPartitionedEnsemble.kfoldLoss

ClassificationPartitionedEnsemble: L = kfoldLoss (obj)
ClassificationPartitionedEnsemble: L = kfoldLoss (…, name, value)

L is the loss of the out-of-fold scores, the held-out observations weighted by W, those without scores left out.

Name-Value arguments:

NameValue
'Folds'The folds to use, pooled. The default is all of them.
'LossFun'A loss CompactClassificationEnsemble.loss accepts. The default is 'classiferror'.
'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 learners of every fold.

See also: ClassificationPartitionedEnsemble, ClassificationPartitionedEnsemble.kfoldEdge

ClassificationPartitionedEnsemble: e = kfoldEdge (obj)
ClassificationPartitionedEnsemble: e = kfoldEdge (…, name, value)

The weighted mean of the out-of-fold margins, weighted by W. 'Folds' and 'Mode' are taken as by kfoldLoss.

See also: ClassificationPartitionedEnsemble, ClassificationPartitionedEnsemble.kfoldMargin

ClassificationPartitionedEnsemble: m = kfoldMargin (obj)

m holds each observation’s margin under its out-of-fold scores, NaN for one no fold held out.

See also: ClassificationPartitionedEnsemble, ClassificationPartitionedEnsemble.kfoldEdge

ClassificationPartitionedEnsemble: 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: ClassificationPartitionedEnsemble

ClassificationPartitionedEnsemble: CVMdl = resume (obj, NumLearningCycles)
ClassificationPartitionedEnsemble: CVMdl = resume (…, ’NPrint’, n)

Each fold’s ensemble is resumed, as ClassificationEnsemble.resume does, by NumLearningCycles learners.

See also: ClassificationPartitionedEnsemble, ClassificationEnsemble.resume