2019-06-22 16:59:43 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2019-09-14 22:32:11 +01:00
|
|
|
, fetchpatch
|
2017-06-05 22:04:28 +01:00
|
|
|
, gfortran, glibcLocales
|
2018-11-12 11:58:40 +00:00
|
|
|
, numpy, scipy, pytest, pillow
|
2019-06-22 16:59:43 +01:00
|
|
|
, cython
|
|
|
|
, joblib
|
|
|
|
, llvmPackages
|
2020-06-11 13:25:54 +01:00
|
|
|
, threadpoolctl
|
2017-06-05 22:04:28 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "scikit-learn";
|
2020-08-16 18:31:15 +01:00
|
|
|
version = "0.23.2";
|
2018-07-26 12:58:58 +01:00
|
|
|
# UnboundLocalError: local variable 'message' referenced before assignment
|
2018-07-29 09:44:20 +01:00
|
|
|
disabled = stdenv.isi686; # https://github.com/scikit-learn/scikit-learn/issues/5534
|
2017-06-05 22:04:28 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-08-16 18:31:15 +01:00
|
|
|
sha256 = "20766f515e6cd6f954554387dfae705d93c7b544ec0e6c6a5d8e006f6f7ef480";
|
2017-06-05 22:04:28 +01:00
|
|
|
};
|
|
|
|
|
2019-06-22 16:59:43 +01:00
|
|
|
buildInputs = [
|
|
|
|
pillow
|
|
|
|
gfortran
|
|
|
|
glibcLocales
|
|
|
|
] ++ lib.optionals stdenv.cc.isClang [
|
|
|
|
llvmPackages.openmp
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
numpy.blas
|
|
|
|
joblib
|
2020-06-11 13:25:54 +01:00
|
|
|
threadpoolctl
|
2019-06-22 16:59:43 +01:00
|
|
|
];
|
2018-11-12 11:58:40 +00:00
|
|
|
checkInputs = [ pytest ];
|
2017-06-05 22:04:28 +01:00
|
|
|
|
|
|
|
LC_ALL="en_US.UTF-8";
|
|
|
|
|
2018-11-13 12:59:20 +00:00
|
|
|
doCheck = !stdenv.isAarch64;
|
2018-11-12 11:58:40 +00:00
|
|
|
# Skip test_feature_importance_regression - does web fetch
|
2017-06-05 22:04:28 +01:00
|
|
|
checkPhase = ''
|
2018-11-12 11:58:40 +00:00
|
|
|
cd $TMPDIR
|
|
|
|
HOME=$TMPDIR OMP_NUM_THREADS=1 pytest -k "not test_feature_importance_regression" --pyargs sklearn
|
2017-06-05 22:04:28 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A set of python modules for machine learning and data mining";
|
2020-05-10 19:41:31 +01:00
|
|
|
changelog = let
|
|
|
|
major = versions.major version;
|
|
|
|
minor = versions.minor version;
|
|
|
|
dashVer = replaceChars ["."] ["-"] version;
|
|
|
|
in
|
|
|
|
"https://scikit-learn.org/stable/whats_new/v${major}.${minor}.html#version-${dashVer}";
|
2020-04-24 16:01:58 +01:00
|
|
|
homepage = "https://scikit-learn.org";
|
2017-06-05 22:04:28 +01:00
|
|
|
license = licenses.bsd3;
|
2018-07-26 12:58:58 +01:00
|
|
|
maintainers = with maintainers; [ ];
|
2017-06-05 22:04:28 +01:00
|
|
|
};
|
|
|
|
}
|