fitcensemble
Fit an ensemble classifier.
📝Syntax
mdl = fitcensemble(X, Y)
mdl = fitcensemble(X, Y, Name, Value)
label = predict(mdl, Xnew)
[label, score] = predict(mdl, Xnew)
📄Description

fitcensemble creates a ClassificationEnsemble object from numeric predictors X and class labels Y.

The current implementation supports Bag ensembles of tree learners. Name-value arguments include ClassNames, Method, Learners, NumLearningCycles, MaxNumSplits, MinLeafSize, and MinParentSize.

💡Examples
X = [0 0; 0 1; 5 5; 5 6; 10 0; 10 1];
Y = [1; 1; 2; 2; 3; 3];
mdl = fitcensemble(X, Y, 'NumLearningCycles', 5);
[label, score] = predict(mdl, [0.2 0.2; 5.2 5.2; 10.2 0.2])
🔗See Also
fitctreefitcecocfitcknn
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub