-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FIX/MNT do not support OOB score for multiclass-multioutput and additional refactoring #19162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@ogrisel it should be OK now to have a first review. |
@thomasjpfan @ogrisel @NicolasHug @adrinjalali @amueller Do you want to have a look at this PR. This could be useful to further review the permutation importance using the OOB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @glemaitre
Co-authored-by: Adrin Jalali <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the general idea (and also the new tests!) but here are some small suggestions to consider before merging. Let me know if you agree or not.
Co-authored-by: Olivier Grisel <[email protected]>
ping @adrinjalali for a second approval :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @glemaitre . LGTM, if you're not worried about the comment bellow, feel free to merge :)
else: | ||
# for regression, n_classes_ does not exist and we create an empty | ||
# axis to be consistent with the classification case and make | ||
# the array operations compatible with the 2 settings | ||
oob_pred_shape = (n_samples, 1, n_outputs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully there is no classifier out there which has an effective n_classes_ > 1
and yet not setting the right flag to say it's a classifier :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not pass our common test then I think.
Refactor the OOB scoring in forest.
TODO:
sklearn
does not have any metric for this case.