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

Skip to content

FIX Remove spurious UserWarning #25129

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
Dec 7, 2022

Conversation

jjerphan
Copy link
Member

@jjerphan jjerphan commented Dec 7, 2022

Reference Issues/PRs

None, reported IRL by @ArturoAmorQ

What does this implement/fix? Explain your changes.

Currently spurious UserWarning e.g.:

Some metric_kwargs have been passed ({'Y_norm_squared': array([143.50454616, ...
       791.29761213, 185.46960351])}) but aren't usable for this case (EuclideanArgKmin64) and will be ignored.

are reported to users.

This is notably the case in example such as this one.

The problem is due to an improper condition.

The condition was not the proper one: it must be a conjuction and not a disjonction.
This is rewritten more naturally using a negation.

The condition was not the proper one: it must be a conjuction
and not a disjonction.

This is rewritten more naturally using a negation.
@glemaitre
Copy link
Member

A small regression test could be nice here.

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.

Otherwise LGTM

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

Copy link
Member

@ArturoAmorQ ArturoAmorQ left a comment

Choose a reason for hiding this comment

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

I confirm that the rendering of the doc no longer raises such spurious warnings. Thanks @jjerphan!

@jeremiedbb jeremiedbb enabled auto-merge (squash) December 7, 2022 16:56
@glemaitre
Copy link
Member

Let's see if the auto-merge is going to work ;)

@jeremiedbb jeremiedbb merged commit e99cd11 into scikit-learn:main Dec 7, 2022
@jeremiedbb jeremiedbb added this to the 1.2 milestone Dec 7, 2022
@jeremiedbb jeremiedbb added the To backport PR merged in master that need a backport to a release branch defined based on the milestone. label Dec 7, 2022
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Dec 7, 2022
Vincent-Maladiere pushed a commit to Vincent-Maladiere/scikit-learn that referenced this pull request Dec 14, 2022
@jjerphan jjerphan deleted the fix/remove-spurious-warnings branch January 12, 2023 08:40
@jjerphan jjerphan modified the milestones: 1.2, 1.2.1 Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug cython Documentation module:metrics No Changelog Needed 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.

5 participants