Random Forest in Classification Learner App: what the inputs are
34 views (last 30 days)
Show older comments
Hello everyone,
I'm about to use Random Forest (Bagged Trees) in the classification learner app to train a set of 350 observations with 27 features.
I'm not a machine learning expert, and so far I understand that RF requires two inputs: - Number of decision trees, and - Number of predictor variables.
However in the app I have two other inputs: - Max number of splits and - Number of learners.
I need help understanding (in simple terms whenever possible) what this two last inputs are so I can set them properly in my training process.
Thanks in advance for any help.
Ame
0 Comments
Accepted Answer
Yash Ubale
on 3 Aug 2018
Hi Ame,
I understand that you want to know the significance of the two parameters. I am explaining the significance of "Number of learners" and "Maximum number of splits" below:
Number of learners - It basically means the number of decision trees in your random forest. Greater the value, greater will be the number of subsets your data will be divided into to train every decision tree.
Maximum number of splits - With decision trees, you can choose a splitting variable at every tree depth using which the data will be split. It basically defines the depth of your decision tree. Very high number may cause overfitting and very low number may cause underfitting.
TreeBagger - https://www.mathworks.com/help/stats/treebagger.html
2 Comments
Yash Ubale
on 7 Aug 2018
Hi Ame,
I understand that you want to understand the algorithm used and the parameters that can be tuned to replicate your results.
The algorithm used by "Classification Learner" is Breiman's 'random forest' algorithm. "Number of predictor variables" is different from "Maximum number of splits" in a sense that the later is any number up to the maximum limit that you have set and the previous one corresponds to the exact number. They can be same if "Number of predictor variables" is equal to the "Maximum number of splits".
As of now you cannot set the number of predicted variables to be randomly selected in each iteration in the "Classification Learner". You have to run it manually and compare the results and then finally choose parameters that best replicate your results. You can write a script and do everything programmatically.
Secondly, if you wish to go through all the parameters that can be tuned to build a robust model kindly go through this link.
https://www.mathworks.com/help/releases/R2018a/stats/choose-a-classifier.html
More Answers (1)
See Also
Categories
Find more on Classification Learner App in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!