Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

FIX allows TransformedTargetRegressor to take nD target #18898

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

panangam
Copy link
Contributor

@panangam panangam commented Nov 23, 2020

Reference Issues/PRs

Fixes #18866

What does this implement/fix? Explain your changes.

This removes check_array call from the fit method of TransformedTargetRegressor and relegate target validation to the transformer. The main motivation was the allow nD target to be used. But this also potentially allows transformers that deal with string or other data types to be used.

Any other comments?

This is my first scikit-learn PR so any feedback welcome!

@panangam panangam changed the title Allows TransformedTargetRegressor to take nD target [MRG]Allows TransformedTargetRegressor to take nD target Nov 24, 2020
@panangam panangam changed the title [MRG]Allows TransformedTargetRegressor to take nD target [MRG] Allows TransformedTargetRegressor to take nD target Nov 24, 2020
@glemaitre glemaitre self-requested a review December 18, 2020 13:42
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.

I think that we should still keep the check_array as a safe guard for the moment. We can style accomodate your use case by allowing nd array in check_array. We can later see if we should do less validation and delegate the y validation to the transformer itself.

Please add an entry to the change log at doc/whats_new/v*.rst. Like the other entries there, please reference this pull request with :pr: and credit yourself (and other contributors if applicable) with :user:.

sklearn/compose/_target.py Outdated Show resolved Hide resolved
sklearn/compose/tests/test_target.py Show resolved Hide resolved
@glemaitre glemaitre changed the title [MRG] Allows TransformedTargetRegressor to take nD target FIX allows TransformedTargetRegressor to take nD target with adequate transformer Dec 18, 2020
@cmarmo
Copy link
Contributor

cmarmo commented Jan 19, 2021

Hi @panangam would you be able to address the comments from the reviewer? Thanks! Feel free to ask if you need some clarifications.

Base automatically changed from master to main January 22, 2021 10:53
@panangam
Copy link
Contributor Author

@glemaitre @cmarmo I know it's been forever but I've finally addressed the comment, bringing check_array back and did the book keeping stuff (commenting, changelogs).

@cmarmo
Copy link
Contributor

cmarmo commented Feb 28, 2021

Hi @panangam thanks for your updates. 0.24 has been released in December 2020, do you mind moving your changelog in doc/whats_new/v1.0.rst? Thanks!

@panangam
Copy link
Contributor Author

panangam commented Mar 1, 2021

Hi @panangam thanks for your updates. 0.24 has been released in December 2020, do you mind moving your changelog in doc/whats_new/v1.0.rst? Thanks!

Oh whoa, we're getting to 1.0? Will do!

@glemaitre glemaitre self-requested a review April 9, 2021 08:57
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

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.

Thank you for the PR @panangam !

LGTM

@thomasjpfan thomasjpfan changed the title FIX allows TransformedTargetRegressor to take nD target with adequate transformer FIX allows TransformedTargetRegressor to take nD target Apr 9, 2021
@thomasjpfan thomasjpfan merged commit 3ff1267 into scikit-learn:main Apr 9, 2021
thomasjpfan pushed a commit to thomasjpfan/scikit-learn that referenced this pull request Apr 19, 2021
…#18898)

Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
@glemaitre glemaitre mentioned this pull request Apr 22, 2021
12 tasks
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.

Fitting a TransformedTargetRegressor to 3D target fails
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.