aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/packages/machine-learning.scm69
1 files changed, 69 insertions, 0 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 454088b1a5..029422677a 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -2370,6 +2370,75 @@ tree boosting (also known as GBDT, GBM) that solve many data science problems
in a fast and accurate way.")
(license license:asl2.0)))
+(define-public python-xgboost
+ (package
+ (inherit xgboost)
+ (name "python-xgboost")
+ (source (package-source xgboost))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'preparations
+ (lambda _
+ ;; Move python-package content to parent directory to silence
+ ;; some warnings about files not being found if we chdir.
+ (rename-file "python-package/xgboost" "xgboost")
+ (rename-file "python-package/README.rst" "README.rst")
+ (rename-file "python-package/setup.cfg" "setup.cfg")
+ (rename-file "python-package/setup.py" "setup.py")
+ ;; Skip rebuilding libxgboost.so.
+ (substitute* "setup.py"
+ (("ext_modules=\\[CMakeExtension\\('libxgboost'\\)\\],") "")
+ (("'install_lib': InstallLib,") ""))))
+ (add-after 'install 'install-version-and-libxgboost
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (pylib (string-append out "/lib/python"
+ ,(version-major+minor
+ (package-version python))
+ "/site-packages"))
+ (xgbdir (string-append pylib "/xgboost"))
+ (version-file (string-append xgbdir "/VERSION"))
+ (libxgboost (string-append (assoc-ref inputs "xgboost")
+ "/lib/libxgboost.so")))
+ (with-output-to-file version-file
+ (lambda ()
+ (display ,(package-version xgboost))))
+ (mkdir-p (string-append xgbdir "/lib"))
+ (symlink libxgboost (string-append xgbdir "/lib"
+ "/libxgboost.so")))))
+ (replace 'check
+ ;; Python-specific tests are located in tests/python.
+ (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+ (when tests?
+ (add-installed-pythonpath inputs outputs)
+ (invoke "pytest" "tests/python"
+ ;; FIXME: CLI tests fail with PermissionError.
+ "--ignore" "tests/python/test_cli.py" "-k"
+ (string-append
+ "not test_cli_regression_demo"
+ ;; The tests below open a network connection.
+ " and not test_model_compatibility"
+ " and not test_get_group"
+ " and not test_cv_no_shuffle"
+ " and not test_cv"
+ " and not test_training"
+ ;; FIXME: May pass in the next version.
+ " and not test_pandas"
+ ;; "'['./runexp.sh']' returned non-zero exit status 1"
+ " and not test_cli_binary_classification"))))))))
+ (native-inputs
+ `(("python-pandas" ,python-pandas)
+ ("python-pytest" ,python-pytest)
+ ("python-scikit-learn" ,python-scikit-learn)))
+ (inputs
+ `(("xgboost" ,xgboost)))
+ (propagated-inputs
+ `(("python-numpy" ,python-numpy)
+ ("python-scipy" ,python-scipy)))
+ (synopsis "Python interface for the XGBoost library")))
+
(define-public python-iml
(package
(name "python-iml")
encies it has on x86_64-linux, even though they are different than those on armhf-linux, say ("bash-mesboot" vs. "bootstrap-binaries"). Fixes <https://bugs.gnu.org/40482>. Reported by Marius Bakke <mbakke@fastmail.com>. * gnu/packages/commencement.scm (define/system-dependent): New macro. (linux-libre-headers-boot0, hurd-core-headers-boot0, ld-wrapper-boot0) (gcc-boot0-intermediate-wrapped, gcc-boot0-wrapped, ld-wrapper-boot3): Define using 'define/system-dependent' instead of 'define' + 'mlambda'. Adjust users so they no longer look like procedure calls. * tests/guix-build.sh: Add test. Ludovic Courtès 2020-03-05guix build: Allow non-package objects in manifest....* guix/scripts/build.scm (options->things-to-build)[manifest->packages]: Remove. Inline map of 'manifest-entry-item'. * tests/guix-build.sh: Add test for "guix build -m" with non-package object. Ludovic Courtès 2020-02-14guix build: Add '--manifest' option....* guix/scripts/build.scm (show-help): Document --manifest argument. (options->things-to-build): When given a manifest, evaluate all the entries. * tests/guix-build.sh: Add test for --manifest. * doc/guix.texi (Additional Build Options): Mention --manifest. * etc/completion/bash/guix: Complete file name if 'guix build' argument is -m. Marius Bakke 2019-11-17guix build: Handle "guix build /….drv" correctly for non-existent derivations....This lets the daemon substitute missing derivations, as in the example at <https://bugs.gnu.org/38226>, instead of failing with ENOENT. * guix/scripts/build.scm (options->things-to-build): In the 'derivation-path?' case, don't fail when 'read-derivation-from-file' raises to ENOENT; return the empty list in that case. (guix-build): Add non-existent '.drv' files to ITEMS. Pass ITEMS in addition to DRV to 'build-derivations'. * tests/guix-build.sh: Add test. Ludovic Courtès 2019-11-17tests: Test "guix build /gnu/store/….drv"....* tests/guix-build.sh: Add test for passing "guix build" a .drv. Ludovic Courtès 2019-11-07gnu: commencement: Ensure 'gnu-make-final' refers to the native 'pkg-config'....Fixes <https://bugs.gnu.org/38093>. When running: guix build --target=arm-linux-gnueabihf -e '(@ (gnu packages base) coreutils)' the '%current-target-system' parameter is set by the time the top-level of (gnu packages commencement) is evaluated. Consequently, we need to ensure that the 'pkg-config' macro evaluates in a context where '%current-target-system' is unset. * gnu/packages/commencement.scm (gnu-make-final): Refer to '%pkg-config' instead of 'pkg-config'. * tests/guix-build.sh: Add test. Ludovic Courtès 2019-07-20ui: 'warn-about-load-error' provides hints for unbound variables....* guix/ui.scm (warn-about-load-error): Add 'unbound-variable' clause. * tests/guix-build.sh: Add test. Ludovic Courtès 2019-07-20ui: 'warn-about-load-error' warns about file/module name mismatches....* guix/discovery.scm (scheme-modules): Rename the inner 'file' to 'relative'. Pass FILE as an addition argument to WARN. * guix/ui.scm (warn-about-load-error): Add 'module' argument (actually, what was called 'file' really contained a module name.) Call 'check-module-matches-file' in the catch-all error case. (check-module-matches-file): New procedure. * tests/guix-build.sh: Test it. Ludovic Courtès 2019-04-19guix build: Accept multiple '-s' options....* guix/scripts/build.scm (%default-options): Remove 'system'. (%options) <--system>: Keep previous occurrences of 'system in RESULT. (options->derivations)[system]: Remove. [systems, things-to-build]: New variables. [compute-derivation]: New procedure. Iterate on all of SYSTEMS to compute the derivations of THINGS-TO-BUILD. * tests/guix-build.sh: Add test for one and multiple '-s' flags. * doc/guix.texi (Additional Build Options): Document this behavior. Ludovic Courtès 2019-04-15guix build: Fix relative file name canonicalization for '--root'....Fixes <https://bugs.gnu.org/35271>. Reported by rendaw <7e9wc56emjakcm@s.rendaw.me>. * guix/scripts/build.scm (register-root): When ROOT is a relative file name, append the basename of ROOT, not ROOT itself. * tests/guix-build.sh: Add test. Ludovic Courtès 2019-02-04daemon: Rename 'NIX_STATE_DIR' and 'NIX_DB_DIR' environment variables....Fixes <https://bugs.gnu.org/22459>. Reported by Jeff Mickey <j@codemac.net>. * guix/config.scm.in (%state-directory): Change NIX_STATE_DIR to GUIX_STATE_DIRECTORY. (%store-database-directory): Change NIX_DB_DIR to GUIX_DATABASE_DIRECTORY. * nix/libstore/globals.cc (Settings::processEnvironment): Likewise. * guix/self.scm (make-config.scm): Likewise. * build-aux/build-self.scm (make-config.scm): Likewise. * build-aux/test-env.in: Likewise. * tests/derivations.scm ("derivation #:leaked-env-vars"): Likewise. * tests/guix-build.sh (GUIX_DAEMON_SOCKET): Likewise. * tests/guix-daemon.sh (socket): Likewise. Ludovic Courtès 2018-10-09guix build: '-f' accepts file-like objects....* guix/scripts/build.scm (options->things-to-build)[validate-type]: Check for 'file-like?'. (options->derivations): Accept 'file-like?'. * tests/guix-build.sh: Add a test with 'computed-file'. * doc/guix.texi (Additional Build Options): Mention file-like objects. Ludovic Courtès 2018-05-04guix build: Nicely report unbound variables with hints....* guix/ui.scm (print-unbound-variable-error): Add "error:" to the message. (report-unbound-variable-error): New procedure, with code formerly in 'report-load-error'. (report-load-error): Use it. (call-with-unbound-variable-handling): New procedure. (with-unbound-variable-handling): New macro. * guix/scripts/build.scm (options->derivations): Wrap body in 'with-unbound-variable-handling'. * tests/guix-build.sh (GUIX_PACKAGE_PATH): Add test. Ludovic Courtès 2018-03-13gnu: time: Update to 1.9....* gnu/packages/time.scm (time): Update to 1.9. * tests/guix-build.sh: Update time package to 1.9. Efraim Flashner 2017-11-11tests: Refer to "time@1.8"....This is a followup to dd00e0919fcecd895ff4e5a646cf068f46ff8d12. * tests/guix-build.sh: Refer to "time@1.8". Ludovic Courtès