gnu: python-scikit-learn: Update to 0.20.1.

* gnu/packages/patches/python-scikit-learn-fix-test-non-determinism.patch:
Delete file.
* gnu/local.mk (dist_patch_DATA): Remove it.
* gnu/packages/machine-learning.scm (python-scikit-learn): Update to 0.20.1.
[source](patches): Remove.
[arguments]: Skip network tests with pytest instead of deleting files.  Make
sure $HOME is writable.
(python2-scikit-learn): Rewrite in terms of PACKAGE-WITH-PYTHON2.
master
Marius Bakke 2018-11-22 01:47:36 +01:00
parent ec8130eb23
commit 7ff3f3d22c
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
3 changed files with 8 additions and 53 deletions

View File

@ -1090,7 +1090,6 @@ dist_patch_DATA = \
%D%/packages/patches/python-fix-tests.patch \
%D%/packages/patches/python2-larch-coverage-4.0a6-compatibility.patch \
%D%/packages/patches/python2-rdflib-drop-sparqlwrapper.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-mox3-python3.6-compat.patch \

View File

@ -706,7 +706,7 @@ computing environments.")
(define-public python-scikit-learn
(package
(name "python-scikit-learn")
(version "0.19.2")
(version "0.20.1")
(source
(origin
(method git-fetch)
@ -716,9 +716,7 @@ computing environments.")
(file-name (git-file-name name version))
(sha256
(base32
"1dk9hdj01c0bny4ps78b7869fjw9gr6qklxf6wyql8h6nh4k19xm"))
(patches (search-patches
"python-scikit-learn-fix-test-non-determinism.patch"))))
"0qv7ir1fy9vjar3llc72yxmfja3gxm5icdf0y3q57vsn3wcdglkz"))))
(build-system python-build-system)
(arguments
`(#:phases
@ -729,11 +727,11 @@ computing environments.")
(lambda _
;; Restrict OpenBLAS threads to prevent segfaults while testing!
(setenv "OPENBLAS_NUM_THREADS" "1")
;; Disable tests that require network access
(delete-file "sklearn/datasets/tests/test_mldata.py")
(delete-file "sklearn/datasets/tests/test_rcv1.py")
(invoke "pytest" "sklearn")
#t))
;; Some tests require write access to $HOME.
(setenv "HOME" "/tmp")
(invoke "pytest" "sklearn" "-m" "not network")))
;; FIXME: This fails with permission denied
(delete 'reset-gzip-timestamps))))
(inputs
@ -753,24 +751,7 @@ data analysis.")
(license license:bsd-3)))
(define-public python2-scikit-learn
(let ((parent (package-with-python2 python-scikit-learn)))
(package (inherit parent)
(arguments
(substitute-keyword-arguments (package-arguments parent)
((#:phases phases)
`(modify-phases ,phases
(replace 'check
(lambda _
;; Restrict OpenBLAS threads to prevent segfaults while testing!
(setenv "OPENBLAS_NUM_THREADS" "1")
;; Some tests expect to be able to write to HOME.
(setenv "HOME" "/tmp")
;; Disable tests that require network access
(delete-file "sklearn/datasets/tests/test_kddcup99.py")
(delete-file "sklearn/datasets/tests/test_mldata.py")
(delete-file "sklearn/datasets/tests/test_rcv1.py")
(invoke "pytest" "sklearn")
#t)))))))))
(package-with-python2 python-scikit-learn))
(define-public python-autograd
(let* ((commit "442205dfefe407beffb33550846434baa90c4de7")

View File

@ -1,25 +0,0 @@
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 <qinhanmin2005@sina.com>
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