Can I use the fitcensemble function to create a Random Forest model?

38 次查看(过去 30 天)
I am new to machine learning classifiers.
I want to develop a Random Forest classification model with my IMU data.
I used the code below, and my question is: Can I call it a Random Forest model, or should I just call it a bagging ensemble model?
baggedEnsemble = fitcensemble(data_train(:,2:end), data_train(:,1),'Method','Bag','NumLearningCycles',100);

回答(1 个)

Govind KM
Govind KM 2024-9-9,7:18
Hi Junwoo,
The primary characteristic of a Random Forest model is to use random subsets of predictors to train individual trees. In the “fitcensemble” function, if the “Method” parameter is passed as “Bag”, then by default the function uses bagging with decision trees as the base learners, utilizing random predictor selections at each split (Square root of the number of predictors by default). This makes it effectively the same as a Random Forest model.
To use bagging without the random selections, the “NumVariablesToSample” parameter can be set to “all”. The Ensemble aggregation method or the weak learners can also be changed as required to make the model created through the “fitcensemble” function different from a Random Forest model. You can refer to the documentation for more details on different options for the ensemble model, including ensemble method and weak learners:
Hope this resoves the confusion.

类别

Help CenterFile Exchange 中查找有关 Classification Ensembles 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by