-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
OOB error in RandomForrest should care about sample weights. #11142
Copy link
Copy link
Closed
Labels
Milestone
Description
I think there is an error in OOB error computation in case of training with sample weights.
I don’t see weights taken into account anywhere in OOB error computation.
opencv/modules/ml/src/rtrees.cpp
Lines 217 to 221 in 2dff9f4
| oobres[j] += val; | |
| oobcount[j]++; | |
| double true_val = w->ord_responses[w->sidx[j]]; | |
| double a = oobres[j]/oobcount[j] - true_val; | |
| oobError += a*a; |
Also the normalization of OOB error only uses number of samples. This should be the sample weight sum in case of weighted samples.
opencv/modules/ml/src/rtrees.cpp
Line 241 in 2dff9f4
| oobError /= n_oob; |
Reactions are currently unavailable