Skip to content

Commit

Permalink
TST Fix failing fastica tests (scikit-learn#26528)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiedbb committed Jun 8, 2023
1 parent 092b7f3 commit 2182544
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sklearn/decomposition/tests/test_fastica.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ def g_test(x):
assert sources.shape == (1000, 2)

assert_allclose(sources_fun, sources)
# the debian 32 bit build with global dtype float32 needs an atol to pass
atol = 1e-7 if global_dtype == np.float32 else 0
# Set atol to account for the different magnitudes of the elements in sources
# (from 1e-4 to 1e1).
atol = np.max(np.abs(sources)) * (1e-5 if global_dtype == np.float32 else 1e-7)
assert_allclose(sources, ica.transform(m.T), atol=atol)

assert ica.mixing_.shape == (2, 2)
Expand Down

0 comments on commit 2182544

Please sign in to comment.