Skip to content
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

Support utils.testing.assert_equal to compare NaN value #13343

Closed
corona10 opened this issue Mar 1, 2019 · 2 comments
Closed

Support utils.testing.assert_equal to compare NaN value #13343

corona10 opened this issue Mar 1, 2019 · 2 comments

Comments

@corona10
Copy link
Contributor

corona10 commented Mar 1, 2019

Description

According to https://bugs.python.org/issue28579 does not work as I expected.
But ML package has a lot of situation to handling NaN value and this situation actually happened
during I worked on #13231 (comment).

assert_equal = _dummy.assertEqual

So my proposal is implementing new assert_equal to support NaN equal operation.

And if this proposal is accepted, I'd like to work on this issue.

Steps/Code to Reproduce

from sklearn.utils.testing import assert_equal

assert_equal(float('NaN'), float('NaN'))

Expected Results

from sklearn.utils.testing import assert_equal

assert_equal(float('NaN'), float('NaN')) # pass

Actual Results

from sklearn.utils.testing import assert_equal

assert_equal(float('NaN'), float('NaN')) # fail

Versions

Scikit-Learn 0.21.dev0

@jnothman
Copy link
Member

jnothman commented Mar 1, 2019

We are no longer really using assert_equal, after moving to pytest. The helpers we use to assert equality between arrays do check for equality of NaN positions.

@corona10
Copy link
Contributor Author

corona10 commented Mar 1, 2019

@jnothman Thanks looks like we can close this issue. I will close this issue.

@corona10 corona10 closed this as completed Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants