Skip to content

Conversation

thomasjpfan
Copy link
Member

Reference Issues/PRs

Related to #24854

What does this implement/fix? Explain your changes.

This PR calls init_subclass in _SetOutputMixin, which allows other mixins to be defined with their own parameters.

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.

I think we should document in "how to develop an estimator" that third parties shouldn't use the same parameters to __init_subclass__ as the one we have.

return X

est = BothMixinEstimator()
assert est.custom_parameter == 123
Copy link
Member

Choose a reason for hiding this comment

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

we should also check that the estimator has the set_output method, to make sure both are executed.

@thomasjpfan thomasjpfan added this to the 1.2 milestone Nov 8, 2022
@glemaitre glemaitre merged commit a923f9e into scikit-learn:main Nov 10, 2022
@glemaitre
Copy link
Member

LGTM Thanks @adrinjalali and @thomasjpfan

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.

3 participants