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.
|
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.
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
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