2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2020-11-04 07:45:03 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, isPy27
|
|
|
|
, pytestCheckHook
|
|
|
|
, numpy
|
|
|
|
, scipy
|
2021-05-14 18:46:36 +00:00
|
|
|
, scikit-learn
|
2020-11-04 07:45:03 +00:00
|
|
|
, pandas
|
|
|
|
, tqdm
|
|
|
|
, slicer
|
|
|
|
, numba
|
|
|
|
, matplotlib
|
|
|
|
, nose
|
|
|
|
, ipython
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "shap";
|
2021-03-24 17:41:56 +00:00
|
|
|
version = "0.39.0";
|
2020-11-04 07:45:03 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "slundberg";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-03-24 17:41:56 +00:00
|
|
|
sha256 = "065c40k6g8sy6ynzk4k8k7iddl18g2b6kb9kg4m6g7npclmn5wvp";
|
2020-11-04 07:45:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
scipy
|
2021-05-14 18:46:36 +00:00
|
|
|
scikit-learn
|
2020-11-04 07:45:03 +00:00
|
|
|
pandas
|
|
|
|
tqdm
|
|
|
|
slicer
|
|
|
|
numba
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
# when importing the local copy the extension is not found
|
|
|
|
rm -r shap
|
|
|
|
'';
|
|
|
|
checkInputs = [ pytestCheckHook matplotlib nose ipython ];
|
|
|
|
# Those tests access the network
|
|
|
|
disabledTests = [
|
|
|
|
"test_kernel_shap_with_a1a_sparse_zero_background"
|
|
|
|
"test_kernel_shap_with_a1a_sparse_nonzero_background"
|
|
|
|
"test_kernel_shap_with_high_dim_sparse"
|
|
|
|
"test_sklearn_random_forest_newsgroups"
|
|
|
|
"test_sum_match_random_forest"
|
|
|
|
"test_sum_match_extra_trees"
|
|
|
|
"test_single_row_random_forest"
|
|
|
|
"test_sum_match_gradient_boosting_classifier"
|
|
|
|
"test_single_row_gradient_boosting_classifier"
|
|
|
|
"test_HistGradientBoostingClassifier_proba"
|
|
|
|
"test_HistGradientBoostingClassifier_multidim"
|
|
|
|
"test_sum_match_gradient_boosting_regressor"
|
|
|
|
"test_single_row_gradient_boosting_regressor"
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-11-04 07:45:03 +00:00
|
|
|
description = "A unified approach to explain the output of any machine learning model";
|
|
|
|
homepage = "https://github.com/slundberg/shap";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ evax ];
|
|
|
|
platforms = platforms.unix;
|
2021-03-06 04:26:11 +00:00
|
|
|
# ModuleNotFoundError: No module named 'sklearn.ensemble.iforest'
|
|
|
|
broken = true;
|
2020-11-04 07:45:03 +00:00
|
|
|
};
|
|
|
|
}
|