ClassificationBaggedEnsemble
Classification ensemble grown by resampling
Description
ClassificationBaggedEnsemble
combines a set of trained weak
learner models and the data on which the learners were trained. Use the
predict
object function to predict the ensemble response for
new data by aggregating predictions from the weak learners.
Creation
Create a bagged classification ensemble object using fitcensemble
. Set the name-value argument Method
of
fitcensemble
to "Bag"
to use bootstrap
aggregation, or 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 machine learning 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 Mdl
, the
Trained
property of Mdl
stores a cell vector
of Mdl.NumTrained
CompactClassificationTree
model objects. For a textual or graphical display
of tree t
in the cell vector,
enter
view(Mdl.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.