From 4fe90ca4c9dc2d0ad19d2346e73814b0ed6af877 Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Wed, 19 Dec 2018 13:26:51 +1100 Subject: [PATCH 1/2] Reduce precision requirements for float32 Fixes #12823 --- sklearn/decomposition/tests/test_pca.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/decomposition/tests/test_pca.py b/sklearn/decomposition/tests/test_pca.py index 84fabf5aa32df..cae1cb50a73df 100644 --- a/sklearn/decomposition/tests/test_pca.py +++ b/sklearn/decomposition/tests/test_pca.py @@ -722,7 +722,7 @@ def check_pca_float_dtype_preservation(svd_solver): assert pca_32.transform(X_32).dtype == np.float32 assert_array_almost_equal(pca_64.components_, pca_32.components_, - decimal=5) + decimal=4) def check_pca_int_dtype_upcast_to_double(svd_solver): From 43344b7c47463d804e67ba9de7d1e115e97ea4fa Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Wed, 19 Dec 2018 14:33:34 +1100 Subject: [PATCH 2/2] Add comment --- sklearn/decomposition/tests/test_pca.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sklearn/decomposition/tests/test_pca.py b/sklearn/decomposition/tests/test_pca.py index cae1cb50a73df..ff7f6b29d67f8 100644 --- a/sklearn/decomposition/tests/test_pca.py +++ b/sklearn/decomposition/tests/test_pca.py @@ -721,6 +721,7 @@ def check_pca_float_dtype_preservation(svd_solver): assert pca_64.transform(X_64).dtype == np.float64 assert pca_32.transform(X_32).dtype == np.float32 + # decimal=5 fails on mac with scipy = 1.1.0 assert_array_almost_equal(pca_64.components_, pca_32.components_, decimal=4)