linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / shap / default.nix
blobabc68709caa4d4f5ac19256ce71bf70bb6698f10
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , isPy27
5 , pytestCheckHook
6 , numpy
7 , scipy
8 , scikitlearn
9 , pandas
10 , tqdm
11 , slicer
12 , numba
13 , matplotlib
14 , nose
15 , ipython
18 buildPythonPackage rec {
19   pname = "shap";
20   version = "0.36.0";
21   disabled = isPy27;
23   src = fetchFromGitHub {
24     owner = "slundberg";
25     repo = pname;
26     rev = "v${version}";
27     sha256 = "1wxnxvbz6avzzfqjfbcqd4v879hvpq4021v31fhdpccr2q317rr9";
28   };
30   propagatedBuildInputs = [
31     numpy
32     scipy
33     scikitlearn
34     pandas
35     tqdm
36     slicer
37     numba
38   ];
40   preCheck = ''
41     export HOME=$TMPDIR
42     # when importing the local copy the extension is not found
43     rm -r shap
44   '';
45   checkInputs = [ pytestCheckHook matplotlib nose ipython ];
46   # Those tests access the network
47   disabledTests = [
48     "test_kernel_shap_with_a1a_sparse_zero_background"
49     "test_kernel_shap_with_a1a_sparse_nonzero_background"
50     "test_kernel_shap_with_high_dim_sparse"
51     "test_sklearn_random_forest_newsgroups"
52     "test_sum_match_random_forest"
53     "test_sum_match_extra_trees"
54     "test_single_row_random_forest"
55     "test_sum_match_gradient_boosting_classifier"
56     "test_single_row_gradient_boosting_classifier"
57     "test_HistGradientBoostingClassifier_proba"
58     "test_HistGradientBoostingClassifier_multidim"
59     "test_sum_match_gradient_boosting_regressor"
60     "test_single_row_gradient_boosting_regressor"
61   ];
63   meta = with lib; {
64     description = "A unified approach to explain the output of any machine learning model";
65     homepage = "https://github.com/slundberg/shap";
66     license = licenses.mit;
67     maintainers = with maintainers; [ evax ];
68     platforms = platforms.unix;
69     # ModuleNotFoundError: No module named 'sklearn.ensemble.iforest'
70     broken = true;
71   };