Skip to content

BUG Fixes FunctionTransformer validation in inverse_transform #20961

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

Conversation

thomasjpfan
Copy link
Member

This PR fixes a bug in FunctionTransformer where inverse_transform stores n_features_in_ based on the input to inverse_transform.

@glemaitre
Copy link
Member

We also need to add in the documentation, the fitted attribute. However, it is only set if validate=True.
Following the discussion in #20874, do we want to set n_features_in_ to None when validate=False?

@glemaitre
Copy link
Member

Oh no, I see that actually, we don't want it to exist then. So we only need to add it to the documentation.

Copy link
Member

@ogrisel ogrisel 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 for the fix.

@ogrisel ogrisel added this to the 1.0 milestone Sep 7, 2021
@ogrisel ogrisel added the To backport PR merged in master that need a backport to a release branch defined based on the milestone. label Sep 7, 2021
@ogrisel
Copy link
Member

ogrisel commented Sep 7, 2021

@glemaitre merge?

@thomasjpfan
Copy link
Member Author

Tagging for #20965 if it gets in.

If it does not get it, I think this PR can also be considered a 1.0.1 bug fix

@glemaitre glemaitre merged commit ba58f3a into scikit-learn:main Sep 8, 2021
@glemaitre
Copy link
Member

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:preprocessing To backport PR merged in master that need a backport to a release branch defined based on the milestone.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants