Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX warn if an estimator does have a concrete __sklearn_tags__ implementation #30516

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

Merged
merged 13 commits into from
Jan 6, 2025

Conversation

glemaitre
Copy link
Member

closes #30479

Catch the error in the case that there is no __sklearn_tags__ implementation in the MRO. We return the default tags and request to inherit from BaseEstimator that implements it.

Copy link

github-actions bot commented Dec 20, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 1e0a0a6. Link to the linter CI: here

Copy link

@LiorxCohen LiorxCohen left a comment

Choose a reason for hiding this comment

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

didnt understand how did you fix that bug

@jeremiedbb jeremiedbb added this to the 1.6.1 milestone Jan 2, 2025
Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

LGTM.

@jeremiedbb
Copy link
Member

So we intend to always raise and require inheriting from BaseEstimator in 1.7 ? Let's mention the version in the warning message and add a comment to remind us to clean up in 1.7

@glemaitre
Copy link
Member Author

So we intend to always raise and require inheriting from BaseEstimator in 1.7 ?

Not really, you could just implement __sklearn_tags__ and the super will be working.

@glemaitre
Copy link
Member Author

I modify the warning slightly to add the version for erroring and discourage defining __sklearn_tags__

Co-authored-by: Jérémie du Boisberranger <[email protected]>
@jeremiedbb jeremiedbb merged commit bf52a0a into scikit-learn:main Jan 6, 2025
30 checks passed
@clindhorst2
Copy link

clindhorst2 commented Jan 6, 2025

When will this be updated in the library on Google Colab? I just ran into this issue when I was trying to use it with the skorch library. I am unfamiliar with the timeline these fixes are corrected.

jeremiedbb added a commit to jeremiedbb/scikit-learn that referenced this pull request Jan 8, 2025
…entation (scikit-learn#30516)

Co-authored-by: Adrin Jalali <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
jeremiedbb added a commit to jeremiedbb/scikit-learn that referenced this pull request Jan 8, 2025
…entation (scikit-learn#30516)

Co-authored-by: Adrin Jalali <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
jeremiedbb added a commit that referenced this pull request Jan 9, 2025
…entation (#30516)

Co-authored-by: Adrin Jalali <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
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.

Version 1.6.X: ClassifierMixIn failing with new __sklearn_tags__ function
6 participants