ClassificationBaggedEnsemble
Classification ensemble grown by resampling
Description
ClassificationBaggedEnsemble
combines a set
of trained weak learner models and data on which these learners were trained. It can
predict ensemble response for new data by aggregating predictions from its weak
learners.
Creation
Create a bagged classification ensemble object (ens
) using
fitcensemble
. Set the name-value pair
argument 'Method'
of fitcensemble
to
'Bag'
to use bootstrap aggregation (bagging, for example, random
forest).
For a description of bagged classification ensembles, see Bootstrap Aggregation (Bagging) and Random Forest.
Properties
Object Functions
compact | Reduce size of classification ensemble model |
compareHoldout | Compare accuracies of two classification models using new data |
crossval | Cross-validate machine learning model |
edge | Classification edge for classification ensemble model |
gather | Gather properties of Statistics and Machine Learning Toolbox object from GPU |
lime | Local interpretable model-agnostic explanations (LIME) |
loss | Classification loss for classification ensemble model |
margin | Classification margins for classification ensemble model |
oobEdge | Out-of-bag classification edge for bagged classification ensemble model |
oobLoss | Out-of-bag classification loss for bagged classification ensemble model |
oobMargin | Out-of-bag classification margins for bagged classification ensemble |
oobPermutedPredictorImportance | Out-of-bag predictor importance estimates for random forest of classification trees by permutation |
oobPredict | Predict out-of-bag labels and scores of bagged classification ensemble |
partialDependence | Compute partial dependence |
plotPartialDependence | Create partial dependence plot (PDP) and individual conditional expectation (ICE) plots |
predict | Predict labels using classification ensemble model |
predictorImportance | Estimates of predictor importance for classification ensemble of decision trees |
resubEdge | Resubstitution classification edge for classification ensemble model |
resubLoss | Resubstitution classification loss for classification ensemble model |
resubMargin | Resubstitution classification margins for classification ensemble model |
resubPredict | Classify observations in classification ensemble by resubstitution |
resume | Resume training of classification ensemble model |
shapley | Shapley values |
testckfold | Compare accuracies of two classification models by repeated cross-validation |
Examples
Tips
For a bagged ensemble of classification trees, the Trained
property of ens
stores a cell vector of
ens.NumTrained
CompactClassificationTree
model objects. For a textual or graphical display
of tree t
in the cell vector,
enter
view(ens.Trained{t})
Alternative Functionality
Bootstrap Aggregation Methods
For classification or regression, you can choose two approaches for bagging:
Classification: create a bagged ensemble using
fitcensemble
orTreeBagger
.Regression: create a bagged ensemble using
fitrensemble
orTreeBagger
.
For help choosing between these approaches, see Ensemble Algorithms and Suggestions for Choosing an Appropriate Ensemble Algorithm.