3
votes

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?

2

2 Answers

1
votes

These parameters are not available in the MATLAB implementation of bagged decision trees, TreeBagger.

0
votes

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...