8000 More informative error message when set_params has invalid values by ogrisel · Pull Request #21542 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

More informative error message when set_params has invalid values #21542

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
merged 5 commits into from
Nov 3, 2021

Conversation

ogrisel
Copy link
Member
@ogrisel ogrisel commented Nov 3, 2021

This makes the message more informative by listing the valid parameters names at the relevant nesting level when calling set_params with invalid parameter names.

See the updated pipeline/meta-estimator tests for examples on how the message is more informative.

@ogrisel ogrisel added this to the 1.1 milestone Nov 3, 2021
Comment on lines +48 to +51
- |Enhancement| All scikit-learn models now generate a more informative
error message when setting invalid hyper-parameters with `set_params`.
:pr:`21542` by :user:`Olivier Grisel <ogrisel>`.

Copy link
Member

Choose a reason for hiding this comment

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

That could go in 1.0.2, no ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I would rather only put bugfixes in bugfix releases.

Copy link
Member

Choose a reason for hiding this comment

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

No problem :D

Suggested change
- |Enhancement| All scikit-learn models now generate a more informative
error message when setting invalid hyper-parameters with `set_params`.
:pr:`21542` by :user:`Olivier Grisel <ogrisel>`.
- |Fix| All scikit-learn models now generate a more informative
error message when setting invalid hyper-parameters with `set_params`.
:pr:`21542` by :user:`Olivier Grisel <ogrisel>`.

Copy link
Member

Choose a reason for hiding this comment

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

Jst kidding. I'm ok with that :)

ogrisel and others added 3 commits November 3, 2021 18:28
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Copy link
Member
@jjerphan jjerphan 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, @ogrisel.

IMO, This is a small change which comes with great value for UX.

Copy link
Member
@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

LGTM

@jjerphan jjerphan merged commit 74016ab into scikit-learn:main Nov 3, 2021
@ogrisel ogrisel deleted the invalid-set_params branch November 5, 2021 15:11
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Nov 29, 2021
…ikit-learn#21542)

* More informative error message when set_params has invalid values

* Update changelog

* Typo [ci skip]

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>

* Typo [ci skip]

Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>

* Simpler, more efficient code

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
…ikit-learn#21542)

* More informative error message when set_params has invalid values

* Update changelog

* Typo [ci skip]

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>

* Typo [ci skip]

Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>

* Simpler, more efficient code

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
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
0