Skip to content

ENH make check_is_fitted to always pass on stateless estimators #29880

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 5 commits into from
Sep 20, 2024

Conversation

adrinjalali
Copy link
Member

This makes check_is_fitted pass on stateless estimators.

cc @glemaitre @OmarManzoor

@adrinjalali adrinjalali added the Developer API Third party developer API related label Sep 18, 2024
Copy link

github-actions bot commented Sep 18, 2024

✔️ Linting Passed

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

Generated for commit: 66d7424. Link to the linter CI: here

Copy link
Contributor

@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @adrinjalali

@OmarManzoor
Copy link
Contributor

@adrinjalali Some tests are failing. We might need to fix those.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @adrinjalali

@glemaitre
Copy link
Member

Uhm I was too fast apparently, we are breaking some API here.

@adrinjalali
Copy link
Member Author

So now check_is_fitted will always check for existence of attributes if they're passed, and only skips that check if no attributes are passed.

@adrinjalali
Copy link
Member Author

Since this is different than when you did the review, I'll let you have another look @OmarManzoor @glemaitre

@OmarManzoor OmarManzoor merged commit 54d1ec9 into scikit-learn:main Sep 20, 2024
30 checks passed
@adrinjalali adrinjalali deleted the check_is_fitted branch September 20, 2024 10:31
kbharat1210 pushed a commit to kbharat1210/scikit-learn that referenced this pull request Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer API Third party developer API related module:utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants