Classification trees are considered weak learners, meaning that they are highly sensitive to the data used to train them. Thus, two slightly different sets of training data can produce two completely different trees and, consequently, different predictions.
However, this weakness can be harnessed as a strength by creating several trees (or, following the analogous naming, a forest). New observations can then be applied to all the trees and the resulting predictions can be compared.
This lesson focuses on ensemble learning methods.
Fit Ensemble Models
Use the fitensemble function to create ensembles for weak learners.
>> mdl = fitensemble(data,responseVarName,Method,N,Learner)
|mdl||Ensemble learning model variable.||data||Table containing the predictors and response values.|
|responseVarName||Response variable name|
|Method||Ensemble learning method.|
|N||Number of ensemble learning cycles.|
Method – Bagging (bootstrap aggregation) and boosting are two most common approaches used in ensemble modeling. The fitensemble function provides several bagging and boosting methods.
Learner – Different learning methods can be used depending on the ensemble method used. One of the most common methods is tree.