20 buildPythonPackage rec {
21 pname = "scikit-learn";
23 disabled = pythonOlder "3.6";
26 inherit pname version;
27 sha256 = "sha256-vvUZeKUewZl3cA/nuGrs6knIJYhPOBF1a3SjsVK7TjU=";
33 ] ++ lib.optionals stdenv.cc.isClang [
42 propagatedBuildInputs = [
50 checkInputs = [ pytestCheckHook pytest-xdist ];
55 export SKLEARN_BUILD_PARALLEL=$NIX_BUILD_CORES
58 doCheck = !stdenv.isAarch64;
61 # Skip test_feature_importance_regression - does web fetch
62 "test_feature_importance_regression"
65 "check_regressors_train"
66 "check_classifiers_train"
67 "xfail_ignored_in_check_estimator"
71 # verbose build outputs needed to debug hard-to-reproduce hydra failures
75 # NuSVC memmap tests causes segmentation faults in certain environments
76 # (e.g. Hydra Darwin machines) related to a long-standing joblib issue
77 # (https://github.com/joblib/joblib/issues/563). See also:
78 # https://github.com/scikit-learn/scikit-learn/issues/17582
79 # Since we are overriding '-k' we need to include the 'disabledTests' from above manually.
80 "-k" "'not (NuSVC and memmap) ${toString (lib.forEach disabledTests (t: "and not ${t}"))}'"
86 export OMP_NUM_THREADS=1
89 pythonImportsCheck = [ "sklearn" ];
92 description = "A set of python modules for machine learning and data mining";
94 major = versions.major version;
95 minor = versions.minor version;
96 dashVer = replaceChars ["."] ["-"] version;
98 "https://scikit-learn.org/stable/whats_new/v${major}.${minor}.html#version-${dashVer}";
99 homepage = "https://scikit-learn.org";
100 license = licenses.bsd3;
101 maintainers = with maintainers; [ davhau ];