1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, numpy
5, cython
6, scipy
7, scikit-learn
8, matplotlib
9, pytestCheckHook
10}:
11
12buildPythonPackage rec {
13 pname = "scikit-learn-extra";
14 version = "0.3.0";
15
16 src = fetchFromGitHub {
17 owner = "scikit-learn-contrib";
18 repo = pname;
19 rev = "refs/tags/v${version}";
20 sha256 = "sha256-dHOwo6NIuhcvIehpuJQ621JEg5O3mnXycAhpTZKaxns=";
21 };
22
23 nativeBuildInputs = [ numpy cython ];
24 propagatedBuildInputs = [ numpy scipy scikit-learn ];
25 nativeCheckInputs = [ matplotlib pytestCheckHook ];
26
27 preCheck = ''
28 # Remove the package in the build dir, because Python defaults to it and
29 # ignores the one in Nix store with cythonized modules.
30 rm -r sklearn_extra
31 '';
32
33 pytestFlagsArray = [ "--pyargs sklearn_extra" ];
34 disabledTestPaths = [
35 "benchmarks"
36 "examples"
37 "doc"
38 ];
39 disabledTests = [
40 "build" # needs network connection
41 "test_all_estimators" # sklearn.exceptions.NotFittedError: Estimator fails to pass `check_is_fitted` even though it has been fit.
42 ];
43
44 # Check packages with cythonized modules
45 pythonImportsCheck = [
46 "sklearn_extra"
47 "sklearn_extra.cluster"
48 "sklearn_extra.robust"
49 "sklearn_extra.utils"
50 ];
51
52 meta = {
53 description = "A set of tools for scikit-learn";
54 homepage = "https://github.com/scikit-learn-contrib/scikit-learn-extra";
55 license = lib.licenses.bsd3;
56 maintainers = with lib.maintainers; [ yl3dy ];
57 };
58}