Skip to content

OOB error in RandomForrest should care about sample weights.  #11142

@codingforfun

Description

@codingforfun

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.

oobError /= n_oob;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions