1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
5 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
8 ;;; Copyright © 2018 Mark Meyer <mark@ofosos.org>
9 ;;; Copyright © 2018 Ben Woodcroft <donttrustben@gmail.com>
10 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
11 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages machine-learning)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix utils)
32 #:use-module (guix download)
33 #:use-module (guix svn-download)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system ocaml)
37 #:use-module (guix build-system python)
38 #:use-module (guix build-system r)
39 #:use-module (guix git-download)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages algebra)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages boost)
44 #:use-module (gnu packages check)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages cran)
47 #:use-module (gnu packages dejagnu)
48 #:use-module (gnu packages gcc)
49 #:use-module (gnu packages image)
50 #:use-module (gnu packages maths)
51 #:use-module (gnu packages mpi)
52 #:use-module (gnu packages ocaml)
53 #:use-module (gnu packages onc-rpc)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages statistics)
58 #:use-module (gnu packages swig)
59 #:use-module (gnu packages xml)
60 #:use-module (gnu packages xorg))
63 ;; The last release is >100 commits behind, so we package from git.
64 (let ((commit "d71d54788bee56ba4cf7522801270152da5209d7"))
67 (version (string-append "2.2.0-1." (string-take commit 8)))
71 (url "https://github.com/libfann/fann.git")
73 (file-name (string-append name "-" version "-checkout"))
76 "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2ski4r6215g5jjhg3x"))))
77 (build-system cmake-build-system)
80 (modify-phases %standard-phases
82 (lambda* (#:key outputs #:allow-other-keys)
83 (let* ((out (assoc-ref outputs "out")))
84 (with-directory-excursion (string-append (getcwd) "/tests")
85 (invoke "./fann_tests"))))))))
86 (home-page "http://leenissen.dk/fann/wp/")
87 (synopsis "Fast Artificial Neural Network")
89 "FANN is a free open source neural network library, which implements
90 multilayer artificial neural networks in C with support for both fully
91 connected and sparsely connected networks.")
92 (license license:lgpl2.1))))
101 (uri (string-append "https://www.csie.ntu.edu.tw/~cjlin/libsvm/"
102 name "-" version ".tar.gz"))
105 "0zd7s19y5vb7agczl6456bn45cj1y64739sslaskw1qk7dywd0bd"))))
106 (build-system gnu-build-system)
108 `(#:tests? #f ;no "check" target
109 #:phases (modify-phases %standard-phases
112 'install ; no ‘install’ target
113 (lambda* (#:key outputs #:allow-other-keys)
114 (let* ((out (assoc-ref outputs "out"))
115 (bin (string-append out "/bin/")))
117 (for-each (lambda (file)
118 (copy-file file (string-append bin file)))
123 (home-page "http://www.csie.ntu.edu.tw/~cjlin/libsvm/")
124 (synopsis "Library for Support Vector Machines")
126 "LIBSVM is a machine learning library for support vector
127 classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and
128 distribution estimation (one-class SVM). It supports multi-class
130 (license license:bsd-3)))
132 (define-public python-libsvm
133 (package (inherit libsvm)
134 (name "python-libsvm")
135 (build-system gnu-build-system)
137 `(#:tests? #f ;no "check" target
138 #:make-flags '("-C" "python")
140 (modify-phases %standard-phases
143 'install ; no ‘install’ target
144 (lambda* (#:key inputs outputs #:allow-other-keys)
145 (let ((site (string-append (assoc-ref outputs "out")
149 (assoc-ref inputs "python") 5) 3)
151 (substitute* "python/svm.py"
152 (("../libsvm.so.2") "libsvm.so.2"))
154 (for-each (lambda (file)
155 (copy-file file (string-append site (basename file))))
156 (find-files "python" "\\.py"))
157 (copy-file "libsvm.so.2"
158 (string-append site "libsvm.so.2")))
161 `(("python" ,python)))
162 (synopsis "Python bindings of libSVM")))
165 ;; The latest release candidate is several years and a couple of fixes have
166 ;; been published since. This is why we download the sources from the SVN
168 (let ((svn-revision 2341))
171 (version (string-append "0.9-rc3-0." (number->string svn-revision)))
175 (url "http://svn.code.sf.net/p/ghmm/code/trunk")
176 (revision svn-revision)))
177 (file-name (string-append name "-" version))
180 "0qbq1rqp94l530f043qzp8aw5lj7dng9wq0miffd7spd1ff638wq"))))
181 (build-system gnu-build-system)
183 `(#:imported-modules (,@%gnu-build-system-modules
184 (guix build python-build-system))
186 (modify-phases %standard-phases
187 (add-after 'unpack 'enter-dir
188 (lambda _ (chdir "ghmm") #t))
190 (add-after 'install 'check
191 (assoc-ref %standard-phases 'check))
192 (add-before 'check 'fix-PYTHONPATH
193 (lambda* (#:key inputs outputs #:allow-other-keys)
194 (let ((python-version ((@@ (guix build python-build-system)
196 (assoc-ref inputs "python"))))
198 (string-append (getenv "PYTHONPATH")
199 ":" (assoc-ref outputs "out")
200 "/lib/python" python-version
203 (add-after 'enter-dir 'fix-runpath
204 (lambda* (#:key outputs #:allow-other-keys)
205 (substitute* "ghmmwrapper/setup.py"
206 (("^(.*)extra_compile_args = \\[" line indent)
207 (string-append indent
208 "extra_link_args = [\"-Wl,-rpath="
209 (assoc-ref outputs "out") "/lib\"],\n"
212 (assoc-ref outputs "out")
215 (add-after 'enter-dir 'disable-broken-tests
217 (substitute* "tests/Makefile.am"
218 ;; GHMM_SILENT_TESTS is assumed to be a command.
219 (("TESTS_ENVIRONMENT.*") "")
220 ;; Do not build broken tests.
224 (("label_higher_order_test.*$")
225 "label_higher_order_test\n"))
227 ;; These Python unittests are broken as there is no gato.
228 ;; See https://sourceforge.net/p/ghmm/support-requests/3/
229 (substitute* "ghmmwrapper/ghmmunittests.py"
230 (("^(.*)def (testNewXML|testMultipleTransitionClasses|testNewXML)"
232 (string-append indent
233 "@unittest.skip(\"Disabled by Guix\")\n"
236 (add-after 'disable-broken-tests 'autogen
238 (invoke "bash" "autogen.sh"))))))
240 `(("python" ,python-2) ; only Python 2 is supported
241 ("libxml2" ,libxml2)))
243 `(("pkg-config" ,pkg-config)
246 ("autoconf" ,autoconf)
247 ("automake" ,automake)
248 ("libtool" ,libtool)))
249 (home-page "http://ghmm.org")
250 (synopsis "Hidden Markov Model library")
252 "The General Hidden Markov Model library (GHMM) is a C library with
253 additional Python bindings implementing a wide range of types of @dfn{Hidden
254 Markov Models} (HMM) and algorithms: discrete, continuous emissions, basic
255 training, HMM clustering, HMM mixtures.")
256 (license license:lgpl2.0+))))
265 "http://micans.org/mcl/src/mcl-"
266 (string-replace-substring version "." "-")
270 "15xlax3z31lsn62vlg94hkm75nm40q4679amnfg13jm8m2bnhy5m"))))
271 (build-system gnu-build-system)
273 `(#:configure-flags (list "--enable-blast")))
276 (home-page "http://micans.org/mcl/")
277 (synopsis "Clustering algorithm for graphs")
279 "The MCL algorithm is short for the @dfn{Markov Cluster Algorithm}, a
280 fast and scalable unsupervised cluster algorithm for graphs (also known as
281 networks) based on simulation of (stochastic) flow in graphs.")
282 ;; In the LICENCE file and web page it says "The software is licensed
283 ;; under the GNU General Public License, version 3.", but in several of
284 ;; the source code files it suggests GPL3 or later.
285 ;; http://listserver.ebi.ac.uk/pipermail/mcl-users/2016/000376.html
286 (license license:gpl3)))
288 (define-public ocaml-mcl
291 (version "12-068oasis4")
296 "https://github.com/fhcrc/mcl/archive/"
298 (file-name (string-append name "-" version ".tar.gz"))
301 "1l5jbhwjpsj38x8b9698hfpkv75h8hn3kj0gihjhn8ym2cwwv110"))))
302 (build-system ocaml-build-system)
304 `(#:ocaml ,ocaml-4.02
305 #:findlib ,ocaml4.02-findlib
307 (modify-phases %standard-phases
308 (add-before 'configure 'patch-paths
310 (substitute* "configure"
311 (("SHELL = /bin/sh") (string-append "SHELL = "(which "sh"))))
312 (substitute* "setup.ml"
314 (string-append "LDFLAGS=-fPIC\"; \"SHELL=" (which "sh"))))
316 (home-page "https://github.com/fhcrc/mcl")
317 (synopsis "OCaml wrappers around MCL")
319 "This package provides OCaml bindings for the MCL graph clustering
321 (license license:gpl3)))
323 (define-public ocaml4.01-mcl
324 (package-with-ocaml4.01 ocaml-mcl))
326 (define-public randomjungle
328 (name "randomjungle")
334 "http://www.imbs-luebeck.de/imbs/sites/default/files/u59/"
335 "randomjungle-" version ".tar_.gz"))
338 "12c8rf30cla71swx2mf4ww9mfd8jbdw5lnxd7dxhyw1ygrvg6y4w"))))
339 (build-system gnu-build-system)
342 (list (string-append "--with-boost="
343 (assoc-ref %build-inputs "boost")))
345 (modify-phases %standard-phases
347 'configure 'set-CXXFLAGS
349 (setenv "CXXFLAGS" "-fpermissive ")
357 `(("gfortran" ,gfortran)
358 ("gfortran:lib" ,gfortran "lib")))
359 ;; Non-portable assembly instructions are used so building fails on
360 ;; platforms other than x86_64 or i686.
361 (supported-systems '("x86_64-linux" "i686-linux"))
362 (home-page "http://www.imbs-luebeck.de/imbs/de/node/227/")
363 (synopsis "Implementation of the Random Forests machine learning method")
365 "Random Jungle is an implementation of Random Forests. It is supposed to
366 analyse high dimensional data. In genetics, it can be used for analysing big
367 Genome Wide Association (GWA) data. Random Forests is a powerful machine
368 learning method. Most interesting features are variable selection, missing
369 value imputation, classifier creation, generalization error estimation and
370 sample proximities between pairs of cases.")
371 (license license:gpl3+)))
373 (define-public shogun
381 "ftp://shogun-toolbox.org/shogun/releases/"
382 (version-major+minor version)
383 "/sources/shogun-" version ".tar.bz2"))
386 "1rn9skm3nw6hr7mr3lgp2gfqhi7ii0lyxck7qmqnf8avq349s5jp"))
387 (modules '((guix build utils)
391 ;; Remove non-free sources and files referencing them
392 (for-each delete-file
393 (find-files "src/shogun/classifier/svm/"
394 "SVMLight\\.(cpp|h)"))
395 (for-each delete-file
396 (find-files "examples/undocumented/libshogun/"
398 "(classifier_.*svmlight.*|"
399 "evaluation_cross_validation_locked_comparison).cpp")))
400 ;; Remove non-free functions.
401 (define (delete-ifdefs file)
402 (with-atomic-file-replacement file
404 (let loop ((line (read-line in 'concat))
406 (if (eof-object? line)
411 "#endif //USE_SVMLIGHT" line)))
413 "#ifdef USE_SVMLIGHT" line))))
414 (when (or (not skipping?)
415 (and skipping? (not skip-next?)))
417 (loop (read-line in 'concat) skip-next?)))))))
418 (for-each delete-ifdefs
420 (find-files "src/shogun/classifier/mkl"
421 "^MKLClassification\\.cpp")
422 (find-files "src/shogun/classifier/svm"
423 "^SVMLightOneClass\\.(cpp|h)")
424 (find-files "src/shogun/multiclass"
425 "^ScatterSVM\\.(cpp|h)")
426 (find-files "src/shogun/kernel/"
427 "^(Kernel|CombinedKernel|ProductKernel)\\.(cpp|h)")
428 (find-files "src/shogun/regression/svr"
429 "^(MKLRegression|SVRLight)\\.(cpp|h)")
430 (find-files "src/shogun/transfer/domain_adaptation"
431 "^DomainAdaptationSVM\\.(cpp|h)")))
433 (build-system cmake-build-system)
435 '(#:tests? #f ;no check target
437 (modify-phases %standard-phases
438 (add-after 'unpack 'delete-broken-symlinks
440 (for-each delete-file '("applications/arts/data"
441 "applications/asp/data"
442 "applications/easysvm/data"
443 "applications/msplicer/data"
444 "applications/ocr/data"
446 "examples/undocumented/data"))
448 (add-after 'unpack 'change-R-target-path
449 (lambda* (#:key outputs #:allow-other-keys)
450 (substitute* '("src/interfaces/r/CMakeLists.txt"
451 "examples/meta/r/CMakeLists.txt")
452 (("\\$\\{R_COMPONENT_LIB_PATH\\}")
453 (string-append (assoc-ref outputs "out")
456 (add-after 'unpack 'fix-octave-modules
457 (lambda* (#:key outputs #:allow-other-keys)
458 (substitute* "src/interfaces/octave/CMakeLists.txt"
459 (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
460 "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave")
461 ;; change target directory
462 (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
463 (string-append (assoc-ref outputs "out")
464 "/share/octave/packages")))
465 (substitute* '("src/interfaces/octave/swig_typemaps.i"
466 "src/interfaces/octave/sg_print_functions.cpp")
467 ;; "octave/config.h" and "octave/oct-obj.h" deprecated in Octave.
468 (("octave/config\\.h") "octave/octave-config.h")
469 (("octave/oct-obj.h") "octave/ovl.h"))
471 (add-after 'unpack 'move-rxcpp
472 (lambda* (#:key inputs #:allow-other-keys)
473 (let ((rxcpp-dir "shogun/third-party/rxcpp"))
475 (install-file (assoc-ref inputs "rxcpp") rxcpp-dir)
477 (add-before 'build 'set-HOME
478 ;; $HOME needs to be set at some point during the build phase
479 (lambda _ (setenv "HOME" "/tmp") #t)))
481 (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
482 "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
483 "-DBUILD_META_EXAMPLES=OFF" ;requires unpackaged ctags
484 ;;"-DINTERFACE_JAVA=ON" ;requires unpackaged jblas
485 ;;"-DINTERFACE_RUBY=ON" ;requires unpackaged ruby-narray
486 ;;"-DINTERFACE_PERL=ON" ;"FindPerlLibs" does not exist
487 ;;"-DINTERFACE_LUA=ON" ;fails because lua doesn't build pkgconfig file
488 "-DINTERFACE_OCTAVE=ON"
489 "-DINTERFACE_PYTHON=ON"
490 "-DINTERFACE_R=ON")))
493 ("numpy" ,python-numpy)
494 ("r-minimal" ,r-minimal)
500 ("arpack" ,arpack-ng)
507 `(("pkg-config" ,pkg-config)
509 ;; Non-portable SSE instructions are used so building fails on platforms
510 ;; other than x86_64.
511 (supported-systems '("x86_64-linux"))
512 (home-page "http://shogun-toolbox.org/")
513 (synopsis "Machine learning toolbox")
515 "The Shogun Machine learning toolbox provides a wide range of unified and
516 efficient Machine Learning (ML) methods. The toolbox seamlessly allows to
517 combine multiple data representations, algorithm classes, and general purpose
518 tools. This enables both rapid prototyping of data pipelines and extensibility
519 in terms of new algorithms.")
520 (license license:gpl3+)))
529 (uri (string-append "https://github.com/ReactiveX/RxCpp/archive/v"
533 "0y2isr8dy2n1yjr9c5570kpc9lvdlch6jv0jvw000amwn5d3krsh"))
534 (file-name (string-append name "-" version ".tar.gz"))))
535 (build-system cmake-build-system)
538 (modify-phases %standard-phases
539 (add-after 'unpack 'remove-werror
541 (substitute* (find-files ".")
546 (invoke "ctest"))))))
548 `(("catch" ,catch-framework)))
549 (home-page "http://reactivex.io/")
550 (synopsis "Reactive Extensions for C++")
552 "The Reactive Extensions for C++ (RxCpp) is a library of algorithms for
553 values-distributed-in-time. ReactiveX is a library for composing asynchronous
554 and event-based programs by using observable sequences.
556 It extends the observer pattern to support sequences of data and/or events and
557 adds operators that allow you to compose sequences together declaratively while
558 abstracting away concerns about things like low-level threading,
559 synchronization, thread-safety, concurrent data structures, and non-blocking
561 (license license:asl2.0)))
563 (define-public r-adaptivesparsity
565 (name "r-adaptivesparsity")
569 (uri (cran-uri "AdaptiveSparsity" version))
572 "0imr5m8mll9j6n4icsv6z9rl5kbnwsp9wvzrg7n90nnmcxq2cz91"))))
574 `((upstream-name . "AdaptiveSparsity")))
575 (build-system r-build-system)
578 (modify-phases %standard-phases
579 (add-after 'unpack 'link-against-armadillo
581 (substitute* "src/Makevars"
582 (("PKG_LIBS=" prefix)
583 (string-append prefix "-larmadillo"))))))))
586 ("r-matrix" ,r-matrix)
588 ("r-rcpparmadillo" ,r-rcpparmadillo)))
590 `(("armadillo" ,armadillo)))
591 (home-page "https://cran.r-project.org/web/packages/AdaptiveSparsity")
592 (synopsis "Adaptive sparsity models")
594 "This package implements the Figueiredo machine learning algorithm for
595 adaptive sparsity and the Wong algorithm for adaptively sparse gaussian
597 (license license:lgpl3+)))
599 (define-public r-kernlab
606 (uri (cran-uri "kernlab" version))
609 "1m0xqf6gyvwayz7w3c83y32ayvnlz0jicj8ijk808zq9sh7dbbgn"))))
610 (build-system r-build-system)
611 (home-page "https://cran.r-project.org/web/packages/kernlab")
612 (synopsis "Kernel-based machine learning tools")
614 "This package provides kernel-based machine learning methods for
615 classification, regression, clustering, novelty detection, quantile regression
616 and dimensionality reduction. Among other methods @code{kernlab} includes
617 Support Vector Machines, Spectral Clustering, Kernel PCA, Gaussian Processes
619 (license license:gpl2)))
628 "http://dlib.net/files/dlib-" version ".tar.bz2"))
631 "1mljz02kwkrbggyncxv5fpnyjdybw2qihaacb3js8yfkw12vwpc2"))
632 (modules '((guix build utils)))
635 ;; Delete ~13MB of bundled dependencies.
636 (delete-file-recursively "dlib/external")
637 (delete-file-recursively "docs/dlib/external")
639 (build-system cmake-build-system)
642 (modify-phases %standard-phases
643 (add-after 'unpack 'disable-asserts
645 ;; config.h recommends explicitly enabling or disabling asserts
646 ;; when building as a shared library. By default neither is set.
647 (substitute* "dlib/config.h"
648 (("^//#define DLIB_DISABLE_ASSERTS") "#define DLIB_DISABLE_ASSERTS"))
650 (add-after 'disable-asserts 'disable-failing-tests
652 ;; One test times out on MIPS, so we need to disable it.
653 ;; Others are flaky on some platforms.
654 (let* ((system ,(or (%current-target-system)
656 (disabled-tests (cond
657 ((string-prefix? "mips64" system)
658 '("object_detector" ; timeout
660 ((string-prefix? "armhf" system)
661 '("learning_to_track"))
662 ((string-prefix? "i686" system)
667 (substitute* "dlib/test/makefile"
668 (((string-append "SRC \\+= " test "\\.cpp")) "")))
673 ;; No test target, so we build and run the unit tests here.
674 (let ((test-dir (string-append "../dlib-" ,version "/dlib/test")))
675 (with-directory-excursion test-dir
676 (invoke "make" "-j" (number->string (parallel-job-count)))
677 (invoke "./dtest" "--runall"))
679 (add-after 'install 'delete-static-library
680 (lambda* (#:key outputs #:allow-other-keys)
681 (delete-file (string-append (assoc-ref outputs "out")
685 `(("pkg-config" ,pkg-config)
694 ("openblas" ,openblas)
697 "Toolkit for making machine learning and data analysis applications in C++")
699 "Dlib is a modern C++ toolkit containing machine learning algorithms and
700 tools. It is used in both industry and academia in a wide range of domains
701 including robotics, embedded devices, mobile phones, and large high performance
702 computing environments.")
703 (home-page "http://dlib.net")
704 (license license:boost1.0)))
706 (define-public python-scikit-learn
708 (name "python-scikit-learn")
714 (url "https://github.com/scikit-learn/scikit-learn.git")
716 (file-name (git-file-name name version))
719 "0qv7ir1fy9vjar3llc72yxmfja3gxm5icdf0y3q57vsn3wcdglkz"))))
720 (build-system python-build-system)
723 (modify-phases %standard-phases
724 (add-after 'build 'build-ext
725 (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace") #t))
728 ;; Restrict OpenBLAS threads to prevent segfaults while testing!
729 (setenv "OPENBLAS_NUM_THREADS" "1")
731 ;; Some tests require write access to $HOME.
732 (setenv "HOME" "/tmp")
734 (invoke "pytest" "sklearn" "-m" "not network")))
735 ;; FIXME: This fails with permission denied
736 (delete 'reset-gzip-timestamps))))
738 `(("openblas" ,openblas)))
740 `(("python-pytest" ,python-pytest)
741 ("python-pandas" ,python-pandas) ;for tests
742 ("python-cython" ,python-cython)))
744 `(("python-numpy" ,python-numpy)
745 ("python-scipy" ,python-scipy)))
746 (home-page "http://scikit-learn.org/")
747 (synopsis "Machine Learning in Python")
749 "Scikit-learn provides simple and efficient tools for data mining and
751 (license license:bsd-3)))
753 (define-public python2-scikit-learn
754 (package-with-python2 python-scikit-learn))
756 (define-public python-autograd
757 (let* ((commit "442205dfefe407beffb33550846434baa90c4de7")
759 (version (git-version "0.0.0" revision commit)))
761 (name "python-autograd")
762 (home-page "https://github.com/HIPS/autograd")
770 "189sv2xb0mwnjawa9z7mrgdglc1miaq93pnck26r28fi1jdwg0z4"))
771 (file-name (git-file-name name version))))
773 (build-system python-build-system)
775 `(("python-nose" ,python-nose)
776 ("python-pytest" ,python-pytest)))
778 `(("python-future" ,python-future)
779 ("python-numpy" ,python-numpy)))
781 `(#:phases (modify-phases %standard-phases
784 (invoke "py.test" "-v"))))))
785 (synopsis "Efficiently computes derivatives of NumPy code")
786 (description "Autograd can automatically differentiate native Python and
787 NumPy code. It can handle a large subset of Python's features, including loops,
788 ifs, recursion and closures, and it can even take derivatives of derivatives
789 of derivatives. It supports reverse-mode differentiation
790 (a.k.a. backpropagation), which means it can efficiently take gradients of
791 scalar-valued functions with respect to array-valued arguments, as well as
792 forward-mode differentiation, and the two can be composed arbitrarily. The
793 main intended application of Autograd is gradient-based optimization.")
794 (license license:expat))))
796 (define-public python2-autograd
797 (package-with-python2 python-autograd))
799 (define-public lightgbm
806 "https://github.com/Microsoft/LightGBM/archive/v"
810 "132zf0yk0545mg72hyzxm102g3hpb6ixx9hnf8zd2k55gas6cjj1"))
811 (file-name (string-append name "-" version ".tar.gz"))))
813 `(("python-pytest" ,python-pytest)
814 ("python-nose" ,python-nose)))
816 `(("openmpi" ,openmpi)))
818 `(("python-numpy" ,python-numpy)
819 ("python-scipy" ,python-scipy)))
824 (modify-phases %standard-phases
826 (lambda* (#:key outputs #:allow-other-keys)
827 (with-directory-excursion ,(string-append "../LightGBM-" version)
828 (invoke "pytest" "tests/c_api_test/test_.py")))))))
829 (build-system cmake-build-system)
830 (home-page "https://github.com/Microsoft/LightGBM")
831 (synopsis "Gradient boosting framework based on decision tree algorithms")
832 (description "LightGBM is a gradient boosting framework that uses tree
833 based learning algorithms. It is designed to be distributed and efficient with
834 the following advantages:
837 @item Faster training speed and higher efficiency
838 @item Lower memory usage
839 @item Better accuracy
840 @item Parallel and GPU learning supported (not enabled in this package)
841 @item Capable of handling large-scale data
843 (license license:expat)))
845 (define-public vowpal-wabbit
846 ;; Language bindings not included.
848 (name "vowpal-wabbit")
853 "https://github.com/JohnLangford/vowpal_wabbit/archive/"
857 "0clp2kb7rk5sckhllxjr5a651awf4s8dgzg4659yh4hf5cqnf0gr"))
858 (file-name (string-append name "-" version ".tar.gz"))))
864 (list (string-append "--with-boost="
865 (assoc-ref %build-inputs "boost")))))
866 (build-system gnu-build-system)
867 (home-page "https://github.com/JohnLangford/vowpal_wabbit")
868 (synopsis "Fast machine learning library for online learning")
869 (description "Vowpal Wabbit is a machine learning system with techniques
870 such as online, hashing, allreduce, reductions, learning2search, active, and
871 interactive learning.")
872 (license license:bsd-3)))