Pred_prob OpenCV 3.0.0 Rtrees - Random Forest Classifier

I am trying to get probability estimates for my RTree classifier. In OpenCV 2.4, there is a pred_prob function for the RTree class, which is not available in the 3.0.0 branch.

As an alternative, I tried to get the number of votes per class (using flags in the prediction function), but this seems to break OpenCV. For now, I will move to version 2.4.11, but I'm curious if anyone understood this.

Relevant documentation:
2.4.11: http://docs.opencv.org/modules/ml/doc/random_trees.html
3.0.0: http://docs.opencv.org/3.0-beta/modules/ml/doc/random_trees.html

Corresponding code in 3.0.0:

cv::Ptr<cv::ml::RTrees> forest = cv::ml::RTrees::load<cv::ml::RTrees>(_ModelFileFld->getStringValue()); cv::Mat result; forest->predict(instance, result, cv::ml::RTrees::Flags::PREDICT_SUM); 
+6
source share

All Articles