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

Skip to content

Conversation

@adrinjalali
Copy link
Member

Fixes #28632

Similar to what we did for available_if, we let these methods to be unbound.

@leycec could you confirm this works for you?

@github-actions
Copy link

github-actions bot commented Mar 18, 2024

✔️ Linting Passed

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

Generated for commit: f74d002. Link to the linter CI: here

@adrinjalali adrinjalali added this to the 1.4.2 milestone Mar 18, 2024
@adrinjalali
Copy link
Member Author

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

@tvdboom
Copy link
Contributor

tvdboom commented Mar 18, 2024

Hi @adrinjalali,

I was the user posting the original issue in beartype. Running this example still fails for me, can you confirm?

import sklearn
from sklearn.base import BaseEstimator
from beartype import beartype

sklearn.set_config(enable_metadata_routing=True)

@beartype
class A(BaseEstimator):
    def fit(self, X, y, sample_weight=None):
        return self

a = A().set_fit_request(sample_weight=True)  # <-- error

@adrinjalali
Copy link
Member Author

I cannot reproduce on this branch @tvdboom , this seems to fix the issue.

@tvdboom
Copy link
Contributor

tvdboom commented Mar 19, 2024

you are right, I messed up the install. Thanks for the fix!:D

@leycec
Copy link

leycec commented Mar 20, 2024

Thanks so much for resolving this so rapidly, @adrinjalali. You're amazingly responsive. I'm blown away and inspired to behave like you. Since I implicitly trust @tvdboom with @beartype's life, let's assume that this now works perfectly.

Thanks again, everybody! I have learned that I should use sklearn for everything. 😄

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.

LGTM

@thomasjpfan thomasjpfan merged commit ee84913 into scikit-learn:main Mar 27, 2024
@adrinjalali adrinjalali deleted the slep6/unbound branch April 2, 2024 04:43
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.

[Bug] sklearn.base.BaseEstimator subclasses not decoratable

5 participants