Skip to content

[MRG] Use assert_allclose when comparing float arrays - #13181

Merged
adrinjalali merged 1 commit into
scikit-learn:masterfrom
thomasjpfan:IterativeImputer_assert
Feb 19, 2019
Merged

adrinjalali merged 1 commit into
scikit-learn:masterfrom
thomasjpfan:IterativeImputer_assert

Conversation

@thomasjpfan

Copy link
Copy Markdown
Member

Small fix to use assert_allclose when comparing float arrays.

@jnothman jnothman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When the numbers have been computed in an identical fashion with no nondeterminism, can we sometimes rely on np.all(x == y)?

@thomasjpfan

Copy link
Copy Markdown
Member Author

I saw test_iterative_imputer_transform_stochasticity error out on Travis CI while working on MacPython/scikit-learn-wheels#17. Here is the travis job link. It is a little strange that it only errors on OSX python 3.7 with numpy 1.14.5. The error also does not reproduce locally on my machine with the same numpy version and python version on OSX.

@adrinjalali

Copy link
Copy Markdown
Member

Can never trust the floats :P

@adrinjalali
adrinjalali merged commit 90d12af into scikit-learn:master Feb 19, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 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

Successfully merging this pull request may close these issues.

3 participants