@param results Array where the result of the calculation will be written.
@param flags Flags for defining the type of RTrees.
*/
- CV_WRAP void getVotes(InputArray samples, OutputArray results, int flags) const;
+ CV_WRAP virtual void getVotes(InputArray samples, OutputArray results, int flags) const = 0;
-#if CV_VERSION_MAJOR == 3
- CV_WRAP double getOOBError() const;
+ /** Returns the OOB error value, computed at the training stage when calcOOBError is set to true.
+ * If this flag was set to false, 0 is returned. The OOB error is also scaled by sample weighting.
+ */
++#if CV_VERSION_MAJOR == 4
++ CV_WRAP virtual double getOOBError() const { return 0; }
+ #else
+ /*CV_WRAP*/ virtual double getOOBError() const = 0;
+ #endif
+
/** Creates the empty model.
Use StatModel::train to train the model, StatModel::train to create and train the model,
Algorithm::load to load the pre-trained model.
const vector<Node>& getNodes() const CV_OVERRIDE { return impl.getNodes(); }
const vector<Split>& getSplits() const CV_OVERRIDE { return impl.getSplits(); }
const vector<int>& getSubsets() const CV_OVERRIDE { return impl.getSubsets(); }
-#if CV_VERSION_MAJOR == 3
- double getOOBError_() const { return impl.getOOBError(); }
-#else
+ double getOOBError() const CV_OVERRIDE { return impl.getOOBError(); }
-#endif
+
DTreesImplForRTrees impl;
};