How to select number of trees and leaf size in bagged regression trees
Mostra commenti meno recenti
Hello guys,
I am using the function TreeBagger to create a regression model.
How can I evaluate the optimal structure, meaning number of trees and leaf size?
I have seen that the number of trees can be assessed using the oobError of the model, but I am not sure if what I am doing is correct.
I am using the following code:
model = TreeBagger(30, trainX, trainY, 'method', 'regression','oobpred', 'on', 'minleaf', 600);
plot(model.oobError);
Can anyone please tell me if this is correct, and how to do the same thing for leaf size?
I am new to Regression Trees so any help would be very much appreciated.
Many thanks,
Natalia
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Classification Ensembles in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!