Skip to content
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

FIX Fix handling of binary_only tag in check_estimator #17812

Merged
merged 2 commits into from
Jul 6, 2020

Conversation

brcharron
Copy link
Contributor

Reference Issues/PRs

Fixes #16798

What does this implement/fix? Explain your changes.

Some checks in check_estimator were generating test cases with more than 2 classes regardless of whether the binary_only tag was provided by the estimator. Fixed these checks so they only generate test cases with up to 2 classes. Also simplified other tests which had special behavior for the binary_only tag by leveraging _enforce_estimator_tags_y. Changed the test to use SGDClassifer as it has a a partial_fit method which did not pass the existing test.

Any other comments?

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thank you @brcharron !

Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! This may deserve a what's new entry? Not sure

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is big enough to be added to whats new:

Please add an entry to the change log at doc/whats_new/v0.24.rst with tag |Fix|. Like the other entries there, please reference this pull request with :pr: and credit yourself (and other contributors if applicable) with :user:.

brcharron added a commit to brcharron/scikit-learn that referenced this pull request Jul 6, 2020
@brcharron
Copy link
Contributor Author

Thanks for the reviews! I added an entry to the What's New page.

@thomasjpfan thomasjpfan changed the title [MRG] Fix handling of binary_only tag in check_estimator FIX Fix handling of binary_only tag in check_estimator Jul 6, 2020
@thomasjpfan thomasjpfan merged commit 9b42b0c into scikit-learn:master Jul 6, 2020
@thomasjpfan
Copy link
Member

Thank you @brcharron !

@gramhagen
Copy link

Thanks @brcharron 🎉

@brcharron brcharron deleted the fix_binary_only branch July 7, 2020 01:11
@ogrisel ogrisel added this to the 0.23.2 milestone Aug 3, 2020
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Aug 3, 2020
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

check_sparsify_coefficients in check_estimator does not respect binary_only tag
6 participants