Skip to content

ENH make check_is_fitted to always pass on stateless estimators#29880

Merged
OmarManzoor merged 5 commits intoscikit-learn:mainfrom
adrinjalali:check_is_fitted
Sep 20, 2024
Merged

ENH make check_is_fitted to always pass on stateless estimators#29880
OmarManzoor merged 5 commits intoscikit-learn:mainfrom
adrinjalali:check_is_fitted

Conversation

@adrinjalali
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@adrinjalali
Copy link
Copy Markdown
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
Copy Markdown
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
@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