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

Skip to content

Conversation

musically-ut
Copy link
Contributor

Fixes #9313.

Supersedes #9384.


Instead of depending on the MNIST dataset in the original test, I've created a similar (random) dataset which also produced the same warnings.

Sidenote: I've had to disable FutureWarning in addition to np.VisibleDeprecationWarning in assert_no_warnings in sklearn.utils.testing. Perhaps this is overreaching a bit, so I could implement a new testing routine which only looks for absence of certain warnings in the output (as a separate PR?)

warut-vijit and others added 4 commits July 16, 2017 15:08
VisibleDeprecationWarning from Numpy is being ignored already
and numpy seems to be moving to FutureWarning as recommended in
PEP scikit-learn#565.
@musically-ut
Copy link
Contributor Author

It looks like the build failures are not strictly related to my changes.

@jnothman
Copy link
Member

What warnings are you silencing?

warnings.simplefilter("always")
# Trigger a warning.
result = func(*args, **kw)
w = [e for e in w
Copy link
Member

Choose a reason for hiding this comment

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

No, please don't change this. Rather use pytest.warns which gives some precision not facilitated here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'll try to rewrite the logic using pytest.warns. Thanks!

@musically-ut
Copy link
Contributor Author

musically-ut commented Oct 30, 2018

Ah, I see that you meant which FutureWarning I was silencing. It was a warning originating from scipy about the correct use of np.issubdtype:

FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.


This fixes the FloatingPointError: Underflow error which calculation of the RBF may raise. On the original issue, we had deemed underflows to be okay to ignore while calculating the distance matrix for LabelPropagation.

@jjerphan
Copy link
Member

Superseded by #19271 which fixes #9313.

@jjerphan jjerphan closed this Jun 10, 2021
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.

[BUG] Underflows in LabelPropagation and LabelSpreading should be ignored.
5 participants