1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
From: Christian Kastner <ckk@debian.org>
Date: Mon, 17 Aug 2020 14:45:57 +0200
Subject: Switch to new scikit-learn parse_version
---
imblearn/metrics/tests/test_classification.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/imblearn/metrics/tests/test_classification.py b/imblearn/metrics/tests/test_classification.py
index e7972f0..326a8d2 100644
--- a/imblearn/metrics/tests/test_classification.py
+++ b/imblearn/metrics/tests/test_classification.py
@@ -14,7 +14,7 @@ from sklearn import datasets
from sklearn import svm
from sklearn.preprocessing import label_binarize
-from sklearn.utils.fixes import np_version
+from sklearn.utils.fixes import np_version, parse_version
from sklearn.utils.validation import check_random_state
from sklearn.utils._testing import assert_allclose
from sklearn.utils._testing import assert_array_equal
@@ -413,7 +413,7 @@ def test_classification_report_imbalanced_multiclass_with_unicode_label():
"red¢ 0.42 0.90 0.55 0.57 0.70 0.51 20 avg / total "
"0.51 0.53 0.80 0.47 0.58 0.40 75"
)
- if np_version[:3] < (1, 7, 0):
+ if np_version < parse_version('1.7.0'):
with pytest.raises(RuntimeError, match="NumPy < 1.7.0"):
classification_report_imbalanced(y_true, y_pred)
else:
|