diff options
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r-- | gnu/packages/machine-learning.scm | 142 |
1 files changed, 107 insertions, 35 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 4e54ca3350..a385ddc18c 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -524,8 +524,8 @@ Performance is achieved by using the LLVM JIT compiler.") (deprecated-package "guile-aiscm-next" guile-aiscm)) (define-public llama-cpp - (let ((commit "03bf161eb6dea6400ee49c6dc6b69bdcfa9fd3fc") - (revision "1")) + (let ((commit "fed0108491a3a3cbec6c6480dc8667ffff9d7659") + (revision "2")) (package (name "llama-cpp") (version (git-version "0.0.0" revision commit)) @@ -537,7 +537,7 @@ Performance is achieved by using the LLVM JIT compiler.") (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "1ag1jash84hasz10h0piw72a8ginm8kzvhihbzzljz96gq2kjm88")))) + (base32 "16rm9gy0chd6k07crm8rkl2j3hg7y7h0km7k6c8q7bmm2jrd64la")))) (build-system cmake-build-system) (arguments (list @@ -559,6 +559,14 @@ Performance is achieved by using the LLVM JIT compiler.") (guix build python-build-system)) #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'disable-unrunable-tests + ;; test-eval-callback downloads ML model from network, cannot + ;; run in Guix build environment + (lambda _ + (substitute* '("examples/eval-callback/CMakeLists.txt") + (("add_test") "#add_test")) + (substitute* '("examples/eval-callback/CMakeLists.txt") + (("set_property") "#set_property")))) (add-before 'install 'install-python-scripts (lambda _ (let ((bin (string-append #$output "/bin/"))) @@ -581,7 +589,7 @@ Performance is achieved by using the LLVM JIT compiler.") (make-script "convert")))) (add-after 'install-python-scripts 'wrap-python-scripts (assoc-ref python:%standard-phases 'wrap)) - (replace 'install + (add-after 'install 'install-main (lambda _ (copy-file "bin/main" (string-append #$output "/bin/llama"))))))) (inputs (list python)) @@ -1680,7 +1688,7 @@ computing environments.") (define-public python-scikit-learn (package (name "python-scikit-learn") - (version "1.3.2") + (version "1.4.2") (source (origin (method git-fetch) @@ -1690,7 +1698,7 @@ computing environments.") (file-name (git-file-name name version)) (sha256 (base32 - "1hr024vcilbjwlwn32ppadri0ypnzjmkfxhkkw8gih0qjvcvjbs7")))) + "0pdd508c9540x9qimq83b8kspb6mb98w7w7i7lnb1jqj7rijal6f")))) (build-system pyproject-build-system) (arguments (list @@ -1700,7 +1708,8 @@ computing environments.") ;; This test tries to access the internet. "not test_load_boston_alternative" ;; DID NOT RAISE <class 'ValueError'> - " and not test_singular_matrix")) + " and not test_check_pandas_sparse_invalid" + )) #:phases '(modify-phases %standard-phases (add-before 'build 'configure @@ -1726,7 +1735,7 @@ computing environments.") test-flags)))))))) (inputs (list openblas)) (native-inputs - (list python-cython-0.29.35 + (list python-cython-3 python-pandas python-pytest python-pytest-xdist)) @@ -1761,26 +1770,30 @@ data analysis.") #:test-flags ;; ignore tests that require network '(list "--pyargs" "sklearn_extra" - "-k" "not test_build") + "-k" (string-append "not test_build" + ;; The error message format has changed, + ;; but the behavior itself is still the + ;; same. + " and not test_parameter_validation")) #:phases - #~(modify-phases %standard-phases - (add-after 'build 'build-ext - (lambda _ - (invoke "python" "setup.py" "build_ext" - "--inplace"))) - (replace 'check - (lambda* (#:key tests? test-flags #:allow-other-keys) - (when tests? - ;; Restrict OpenBLAS threads to prevent segfaults while testing! - (setenv "OPENBLAS_NUM_THREADS" "1") - - ;; Some tests require write access to $HOME. - (setenv "HOME" "/tmp") - - ;; Step out of the source directory to avoid interference; - ;; we want to run the installed code with extensions etc. - (with-directory-excursion "/tmp" - (apply invoke "pytest" "-vv" test-flags)))))))) + #~(modify-phases %standard-phases + (add-after 'build 'build-ext + (lambda _ + (invoke "python" "setup.py" "build_ext" + "--inplace"))) + (replace 'check + (lambda* (#:key tests? test-flags #:allow-other-keys) + (when tests? + ;; Restrict OpenBLAS threads to prevent segfaults while testing! + (setenv "OPENBLAS_NUM_THREADS" "1") + + ;; Some tests require write access to $HOME. + (setenv "HOME" "/tmp") + + ;; Step out of the source directory to avoid interference; + ;; we want to run the installed code with extensions etc. + (with-directory-excursion "/tmp" + (apply invoke "pytest" "-vv" test-flags)))))))) (propagated-inputs (list python-numpy python-scikit-learn @@ -1883,13 +1896,13 @@ for scientific computing and data science (e.g. BLAS and OpenMP).") (define-public python-imbalanced-learn (package (name "python-imbalanced-learn") - (version "0.11.0") + (version "0.12.2") (source (origin (method url-fetch) (uri (pypi-uri "imbalanced-learn" version)) (sha256 - (base32 "1p4gdgc8nsq0vjmw4y4d2bp9g0m1c23d0zgrzs90pnz6b24ax0km")))) + (base32 "1hgncab4g4xry7yl6wwsj1wmfnxbsajx6qmycvr28wdhvk75c358")))) (build-system pyproject-build-system) (arguments (list @@ -1910,7 +1923,6 @@ for scientific computing and data science (e.g. BLAS and OpenMP).") python-flake8 python-keras python-mypy - python-numpydoc python-pandas python-pytest python-pytest-cov @@ -2054,7 +2066,7 @@ standard feature selection algorithms.") (define-public python-cleanlab (package (name "python-cleanlab") - (version "2.2.0") + (version "2.6.3") ;; The version on pypi does not come with tests. (source (origin (method git-fetch) @@ -2064,7 +2076,7 @@ standard feature selection algorithms.") (file-name (git-file-name name version)) (sha256 (base32 - "00dqhxpwg781skknw943ynll2s44g4j125dx8aapk1d5d71sbzqy")))) + "1f5iq4f8rzvn8scrwgfvc9qaqs9h159wiiy7wp6526frr67xk918")))) (build-system pyproject-build-system) (arguments (list @@ -2074,8 +2086,16 @@ standard feature selection algorithms.") '(list "-k" "not test_aux_inputs" ;; Requires Tensorflow "--ignore=tests/test_frameworks.py" + ;; These need datasets, which needs jax, so it could only live in + ;; the guix-science channel. + "--ignore-glob=tests/datalab/**" ;; Tries to download datasets from the internet at runtime. - "--ignore=tests/test_dataset.py"))) + "--ignore=tests/test_dataset.py") + #:phases + '(modify-phases %standard-phases + (add-after 'unpack 'remove-datasets + (lambda _ + (delete-file "tests/datalab/conftest.py")))))) (propagated-inputs (list python-numpy python-pandas @@ -3913,7 +3933,7 @@ methodxs at scale on CPU or GPU.") (define-public python-umap-learn (package (name "python-umap-learn") - (version "0.5.5") + (version "0.5.6") (source (origin (method git-fetch) ;no tests in pypi release @@ -3923,10 +3943,14 @@ methodxs at scale on CPU or GPU.") (file-name (git-file-name name version)) (sha256 (base32 - "0ijyiaqycynwj1383cxp519c765gjbg1f6fjwbvqj1gims710w3d")))) + "0rb0nx0zwi5gddiqil20ssqwb45a8w9fk65bnam001kp7vqjb9ky")))) (build-system pyproject-build-system) (arguments (list + #:test-flags + ;; XXX: this one fails with unusually large deviation from the expected + ;; result. + '(list "-k" "not test_umap_update_large") #:phases #~(modify-phases %standard-phases ;; Numba needs a writable dir to cache functions. @@ -5111,6 +5135,54 @@ linear algebra routines needed for structured matrices (or operators).") "GPyTorch is a Gaussian process library implemented using PyTorch.") (license license:expat))) +(define-public python-botorch + (package + (name "python-botorch") + (version "0.11.0") + (source (origin + (method git-fetch) ;no tests in PyPI + (uri (git-reference + (url "https://github.com/pytorch/botorch") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1b10xydxl6x5y5kzvf0561da5374zh00nwq7fcmdw6mb1axipgbq")))) + (build-system pyproject-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'lo-version + (lambda _ + (substitute* "requirements.txt" + ;; Linear Operator 0.5.2 is a bug-fix release. + (("linear_operator==0.5.1") + "linear_operator==0.5.2") + ;; We have PyTorch 1.13.1, but the reported + ;; version is 1.13.0a0+gitunknown. + (("torch>=1.13.1") "torch")))) + (add-before 'build 'pretend-version + ;; The version string is usually derived via setuptools-scm, + ;; but without the git metadata available, the version string + ;; is set to '0.0.0'. + (lambda _ + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" + #$(package-version this-package))))))) + (propagated-inputs (list python-gpytorch + python-linear-operator + python-multipledispatch + python-pyro-ppl + python-pytorch + python-scipy)) + (native-inputs (list python-pytest + python-pytest-cov + python-setuptools-scm)) + (home-page "https://botorch.org") + (synopsis "Bayesian Optimization in PyTorch") + (description + "BoTorch is a library for Bayesian Optimization built on PyTorch.") + (license license:expat))) + (define-public vosk-api (let* ((openfst openfst-for-vosk) (kaldi kaldi-for-vosk)) |