1{ stdenv, buildPythonPackage, fetchPypi, isPy27
2, nose
3, pandas
4, pytest
5, scikitlearn
6, tensorflow
7}:
8
9buildPythonPackage rec {
10 pname = "imbalanced-learn";
11 version = "0.7.0";
12 disabled = isPy27; # scikit-learn>=0.21 doesn't work on python2
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "da59de0d1c0fa66f62054dd9a0a295a182563aa1abbb3bf9224a3678fcfe8fa4";
17 };
18
19 propagatedBuildInputs = [ scikitlearn ];
20 checkInputs = [ nose pytest pandas ];
21 checkPhase = ''
22 export HOME=$TMPDIR
23 # skip some tests that fail because of minimal rounding errors
24 # or very large dependencies (keras + tensorflow)
25 py.test imblearn -k 'not estimator \
26 and not classification \
27 and not _generator \
28 and not show_versions'
29 '';
30
31 meta = with stdenv.lib; {
32 description = "Library offering a number of re-sampling techniques commonly used in datasets showing strong between-class imbalance";
33 homepage = "https://github.com/scikit-learn-contrib/imbalanced-learn";
34 license = licenses.mit;
35 };
36}