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