From 8a6cd65a2a66107b5a1ae12138a9af0002f55983 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Thu, 14 Dec 2017 18:45:21 +1000 Subject: gnu: python-scikit-learn: Patch test non-determinism. * gnu/packages/patches/python-scikit-learn-fix-test-non-determinism.patch: New file. * gnu/packages/machine-learning.scm (python-scikit-learn)[source]: Use it. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/machine-learning.scm | 4 +++- ...hon-scikit-learn-fix-test-non-determinism.patch | 25 ++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-scikit-learn-fix-test-non-determinism.patch (limited to 'gnu') diff --git a/gnu/local.mk b/gnu/local.mk index 46829756b7..f6b29a7155 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1014,6 +1014,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-parse-too-many-fields.patch \ %D%/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ %D%/packages/patches/python-statsmodels-fix-tests.patch \ + %D%/packages/patches/python-scikit-learn-fix-test-non-determinism.patch \ %D%/packages/patches/python-configobj-setuptools.patch \ %D%/packages/patches/python-faker-fix-build-32bit.patch \ %D%/packages/patches/python-pandas-skip-failing-tests.patch \ diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index cf400a0eed..c8bd5d7747 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -621,7 +621,9 @@ computing environments.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "18n8775kyfwbvcjjjzda9c5sqy4737c0hrmj6qj1ps2jmlqzair9")))) + "18n8775kyfwbvcjjjzda9c5sqy4737c0hrmj6qj1ps2jmlqzair9")) + (patches (search-patches + "python-scikit-learn-fix-test-non-determinism.patch")))) (build-system python-build-system) (arguments `(#:phases diff --git a/gnu/packages/patches/python-scikit-learn-fix-test-non-determinism.patch b/gnu/packages/patches/python-scikit-learn-fix-test-non-determinism.patch new file mode 100644 index 0000000000..90328cc0eb --- /dev/null +++ b/gnu/packages/patches/python-scikit-learn-fix-test-non-determinism.patch @@ -0,0 +1,25 @@ +This patch stops a test sometimes failing because of non-determinism. See +https://github.com/scikit-learn/scikit-learn/pull/9542 + +From ff9f6db6e8b59c2b3528c8137ed4054f57c1d7c4 Mon Sep 17 00:00:00 2001 +From: Hanmin Qin +Date: Sun, 13 Aug 2017 22:13:49 +0800 +Subject: [PATCH] add random_state + +--- + sklearn/tests/test_kernel_ridge.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sklearn/tests/test_kernel_ridge.py b/sklearn/tests/test_kernel_ridge.py +index 4750a096ac6..979875870b6 100644 +--- a/sklearn/tests/test_kernel_ridge.py ++++ b/sklearn/tests/test_kernel_ridge.py +@@ -10,7 +10,7 @@ + from sklearn.utils.testing import assert_array_almost_equal + + +-X, y = make_regression(n_features=10) ++X, y = make_regression(n_features=10, random_state=0) + Xcsr = sp.csr_matrix(X) + Xcsc = sp.csc_matrix(X) + Y = np.array([y, y]).T -- cgit v1.2.3