Ask Your Question
0

Random forest implementations in opencv 3.3

asked 2018-01-02 15:23:37 -0600

waschbaer gravatar image

Hi,

the cv::ml::RTrees::create() construct a Random Forest, but I think this RTrees class is actually not finished to implement right? Because you can not find a constructor with number of trees you want to build, and many useful functions are also not defined. I just want to be sure, this class is currently still not applicable right? And I have to define getVotes(), create()... by myself?

Best,bear

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-01-03 04:45:16 -0600

berak gravatar image

the tree count is hidden in the TermCriteria:

/** The termination criteria that specifies when the training algorithm stops.
Either when the specified number of trees is trained and added to the ensemble or when
sufficient accuracy (measured as OOB error) is achieved. Typically the more trees you have the
better the accuracy. However, the improvement in accuracy generally diminishes and asymptotes
pass a certain number of trees. Also to keep in mind, the number of tree increases the
prediction time linearly. Default value is TermCriteria(TermCriteria::MAX_ITERS +
TermCriteria::EPS, 50, 0.1)*/
/** @see setTermCriteria */
CV_WRAP virtual TermCriteria getTermCriteria() const = 0;
/** @copybrief getTermCriteria @see getTermCriteria */
CV_WRAP virtual void setTermCriteria(const TermCriteria &val) = 0;

and getVotes() and create() can be found here

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-01-02 15:23:37 -0600

Seen: 245 times

Last updated: Jan 03 '18