cv::ml::rtrees oob error
Hi
I'm using cv::ml::rtrees and am looking to access the out-of-bag error. Is there a way to access this in code (i.e. access some variable or call a getter that provides this value)? I know that this value gets written to file on calling write from the model (this variable is part of DTreesImplForRTrees which is inaccessible). How can I access it without having to call write?
Somewhat related question: cv::ml::statmodel also has a method call CalcError which is inherited by rtrees. Calling this method, however, gives an error which is different (as far as I can see) from the oob error. I wonder if anyone has any input in clarifying how this is calculated. I have looked at the code and it seems to be general code for all classifiers (not specific to rtrees, so no equivalent to oob error). If after running training I set test=false while calling CalcError, I get an error different from 0, even though I am running it on the training data set and have not set any splits for training. Should this error not be 0?
Thanks
opencv version ?
4.1.0 but I think it happens in any
yea, just because some recent change in calcError
That change of adding weights applies to calcError. I imagine that before the change the error would've been still different from the oob error, wouldn't it?
i think so, too.
Since they are different, I think I'd prefer to use the oob error for rtrees (it just seems like the better approach) rather than using the general code. I can implement a (not very efficient) workaround to access the oob error but it'd be nice to be able to access it directly...