aboutsummary
aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/python.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/python.scm')
-rw-r--r--gnu/packages/python.scm68
1 files changed, 68 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 746c40a640..ee2f5d073a 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -1952,6 +1952,74 @@ sources.")
(define-public python2-sphinx-rtd-theme
(package-with-python2 python-sphinx-rtd-theme))
+(define-public python-scikit-learn
+ (package
+ (name "python-scikit-learn")
+ (version "0.15.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/scikit-learn/scikit-learn/archive/"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1rb93h2q15f219sz60sczjb65rg70xjmnp0q4pkkaairx5s05q55"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (alist-cons-before
+ 'build 'set-environment-variables
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((atlas-threaded
+ (string-append (assoc-ref inputs "atlas")
+ "/lib/libtatlas.so"))
+ ;; On single core CPUs only the serial library is created.
+ (atlas-lib
+ (if (file-exists? atlas-threaded)
+ atlas-threaded
+ (string-append (assoc-ref inputs "atlas")
+ "/lib/libsatlas.so"))))
+ (setenv "ATLAS" atlas-lib)))
+ (alist-cons-before
+ 'check 'set-HOME
+ ;; some tests require access to "$HOME"
+ (lambda _ (setenv "HOME" "/tmp"))
+ ;; Tests can only be run after the library has been installed and not
+ ;; within the source directory.
+ (alist-cons-after
+ 'install 'check
+ (lambda _
+ (with-directory-excursion "/tmp"
+ ;; With Python 3 one test of 3334 fails
+ ;; (sklearn.tests.test_common.test_transformers); see
+ ;; https://github.com/scikit-learn/scikit-learn/issues/3693
+ (system* "nosetests" "-v" "sklearn")))
+ (alist-delete 'check %standard-phases))))))
+ (inputs
+ `(("atlas" ,atlas)
+ ("python-nose" ,python-nose)))
+ (propagated-inputs
+ `(("python-numpy" ,python-numpy)
+ ("python-scipy" ,python-scipy)))
+ (home-page "http://scikit-learn.org/")
+ (synopsis "Machine Learning in Python")
+ (description
+ "Scikit-learn provides simple and efficient tools for data
+mining and data analysis.")
+ (license bsd-3)))
+
+(define-public python2-scikit-learn
+ (let ((scikit (package-with-python2 python-scikit-learn)))
+ (package (inherit scikit)
+ (propagated-inputs
+ `(("python2-numpy" ,python2-numpy)
+ ("python2-scipy" ,python2-scipy)
+ ,@(alist-delete
+ "python-numpy"
+ (alist-delete
+ "python-scipy" (package-propagated-inputs scikit))))))))
+
(define-public python-cython
(package
(name "python-cython")
x derivations can use derivations produced by Nix (and vice versa). With Nix and the [[https://nixos.org/nixpkgs][Nixpkgs]] distribution, package composition happens at the Nix language level, but builders are usually written in Bash. Conversely, Guix encourages the use of Scheme for both package composition and builders. Likewise, the core functionality of Nix is written in C++ and Perl; Guix relies on some of the original C++ code, but exposes all the API as Scheme. * Related software - [[https://nixos.org][Nix, Nixpkgs, and NixOS]], functional package manager and associated software distribution, are the inspiration of Guix - [[https://www.gnu.org/software/stow/][GNU Stow]] builds around the idea of one directory per prefix, and a symlink tree to create user environments - [[https://www.pvv.ntnu.no/~arnej/store/storedoc_6.html][STORE]] shares the same idea - [[https://live.gnome.org/OSTree/][GNOME's OSTree]] allows bootable system images to be built from a specified set of packages - The [[https://www.gnu.org/s/gsrc/][GNU Source Release Collection]] (GSRC) is a user-land software distribution; unlike Guix, it relies on core tools available on the host system