In OpenCV, random forests can be built using the RTrees_create function from the ml module:
In [7]: import cv2... rtree = cv2.ml.RTrees_create()
The tree object provides a number of options, the most important of which are the following:
- setMaxDepth: This sets the maximum possible depth of each tree in the ensemble. The actual obtained depth may be smaller if other termination criteria are met first.
- setMinSampleCount: This sets the minimum number of samples that a node can contain for it to get split.
- setMaxCategories: This sets the maximum number of categories allowed. Setting the number of categories to a smaller value than the actual number of classes in the data performs subset estimation.
- setTermCriteria ...