10000 [MRG] TST/FIX stop optics reachability failure on 32bit by jnothman · Pull Request #11916 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Dismiss alert

[MRG] TST/FIX stop optics reachability failure on 32bit #11916

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 4 commits into from
Aug 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions sklearn/cluster/tests/test_optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
from sklearn.metrics.cluster import contingency_matrix
from sklearn.cluster.dbscan_ import DBSCAN
from sklearn.utils.testing import assert_equal, assert_warns
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raise_message
from sklearn.utils.testing import assert_allclose
from sklearn.utils import _IS_32BIT

from sklearn.cluster.tests.common import generate_clustered_data

Expand Down Expand Up @@ -405,4 +406,10 @@ def test_reach_dists():
1.364861, 0.459580, 1.025370, 0.980304, 0.607592, 0.533907, 1.134650,
0.446161, 0.629962]

assert_array_almost_equal(clust.reachability_, np.array(v))
# FIXME: known failure in 32bit Linux; numerical imprecision results in
# different ordering in quick_scan
if _IS_32BIT: # pragma: no cover
assert_allclose(clust.reachability_, np.array(v), rtol=1e-2)
else:
# we compare to truncated decimals, so use atol
assert_allclose(clust.reachability_, np.array(v), atol=1e-5)
0