简体   繁体   中英

TreeBagger (Random Forests) Parameters in MATLAB

When I compared the Random Forest implementation of MATLAB ( TreeBagger class) with the OpenCV implementation (Random Trees class), I found that several parameters that are present in the latter were not present in the former.

The parameters of interest are the maximum depth of the trees (max_depth), and max_categories.

Does anyone know how to access these parameters in MATLAB?

这些参数在袋装决策树( TreeBagger的MATLAB实现中TreeBagger

The command B.Trees{1}.NumNodes will return you the number of nodes of the first tree, where B is your model.

And according to this paper the average hight of a binary tree is calculated:

Hight = sqrt(2*pi*n), with n being the number of nodes.

See page 2, which is quite close to the bottom of the .pdf because it's reversed.

However, I have my doubt about this formula...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM