Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

TreeBagger class -

Bootstrap aggregation for ensemble of decision trees

Description

TreeBagger bags an ensemble of decision trees for either classification or regression. Bagging stands for bootstrap aggregation. Every tree in the ensemble is grown on an independently drawn bootstrap replica of input data. Observations not included in this replica are "out of bag" for this tree. To compute prediction of an ensemble of trees for unseen data, TreeBagger takes an average of predictions from individual trees. To estimate the prediction error of the bagged ensemble, you can compute predictions for each tree on its out-of-bag observations, average these predictions over the entire ensemble for each observation and then compare the predicted out-of-bag response with the true value at this observation.

TreeBagger relies on the classregtree functionality for growing individual trees. In particular, classregtree accepts the number of features selected at random for each decision split as an optional input argument.

The Compact property contains another class, CompactTreeBagger, with sufficient information to make predictions using new data. This information includes the tree ensemble, variable names, and class names (for classification). CompactTreeBagger requires less memory than TreeBagger, but only TreeBagger has methods for growing more trees for the ensemble. Once you grow an ensemble of trees using TreeBagger and no longer need access to the training data, you can opt to work with the compact version of the trained ensemble from then on.

Construction

TreeBaggerCreate ensemble of bagged decision trees

Methods

appendAppend new trees to ensemble
compactCompact ensemble of decision trees
errorError (misclassification probability or MSE)
fillProximitiesProximity matrix for training data
growTreesTrain additional trees and add to ensemble
marginClassification margin
mdsProxMultidimensional scaling of proximity matrix
meanMarginMean classification margin
oobErrorOut-of-bag error
oobMarginOut-of-bag margins
oobMeanMarginOut-of-bag mean margins
oobPredictEnsemble predictions for out-of-bag observations
predictPredict response

Properties

ClassNamesNames of classes
ComputeOOBPredictionFlag to compute out-of-bag predictions
ComputeOOBVarImpFlag to compute out-of-bag variable importance
CostMisclassification costs
DefaultYfitDefault value returned by predict and oobPredict
DeltaCritDecisionSplitSplit criterion contributions for each predictor
FBootFraction of in-bag observations
MergeLeavesFlag to merge leaves that do not improve risk
MethodMethod used by trees (classification or regression)
MinLeafMinimum number of observations per tree leaf
NTreesNumber of decision trees in ensemble
NVarToSampleNumber of variables for random feature selection
OOBIndicesIndicator matrix for out-of-bag observations
OOBInstanceWeightCount of out-of-bag trees for each observation
OOBPermutedVarCountRaiseMarginVariable importance for raising margin
OOBPermutedVarDeltaErrorVariable importance for classification error
OOBPermutedVarDeltaMeanMarginVariable importance for classification margin
OutlierMeasureMeasure for determining outliers
PriorPrior class probabilities
ProximityProximity matrix for observations
PruneFlag to prune trees
SampleWithReplacementFlag to sample with replacement
TreeArgsCell array of arguments for classregtree
TreesDecision trees in ensemble
VarNamesVariable names
XX data used to create ensemble
YY data used to create ensemble

Copy Semantics

Value. To learn how this affects your use of the class, see Comparing Handle and Value Classes in the MATLAB Object-Oriented Programming documentation.

See Also

Regression and Classification by Bagging Decision Trees

Classification Trees

Regression Tress

Grouped Data

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS