From e7d4d9941b6399fb4c7a86c1d83444afa75287a3 Mon Sep 17 00:00:00 2001 From: Christian Kastner Date: Mon, 17 Aug 2020 15:04:56 +0200 Subject: [PATCH] Switch to parse_version() of scikit-learn >= 0.23.2 Closes: #746 --- README.rst | 2 +- doc/install.rst | 2 +- imblearn/metrics/tests/test_classification.py | 4 ++-- requirements.txt | 2 +- setup.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 98561a41f..58182f095 100644 --- a/README.rst +++ b/README.rst @@ -54,7 +54,7 @@ The dependency requirements are based on the last scikit-learn release: * scipy(>=0.19.1) * numpy(>=1.13.3) -* scikit-learn(>=0.23) +* scikit-learn(>=0.23.2) * joblib(>=0.11) * keras 2 (optional) * tensorflow (optional) diff --git a/doc/install.rst b/doc/install.rst index 9dd3c83af..8102bbbaf 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -10,7 +10,7 @@ The imbalanced-learn package requires the following dependencies: * python (>=3.6) * numpy (>=1.13.3) * scipy (>=0.19.1) -* scikit-learn (>=0.23) +* scikit-learn (>=0.23.2) * keras 2 (optional) * tensorflow (optional) diff --git a/imblearn/metrics/tests/test_classification.py b/imblearn/metrics/tests/test_classification.py index e7972f03d..326a8d24e 100644 --- a/imblearn/metrics/tests/test_classification.py +++ b/imblearn/metrics/tests/test_classification.py @@ -14,7 +14,7 @@ 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: diff --git a/requirements.txt b/requirements.txt index 48b119f92..caa134c89 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ numpy>=1.11 scipy>=0.17 -scikit-learn>=0.23 +scikit-learn>=0.23.2 joblib>=0.11 diff --git a/setup.py b/setup.py index 522755630..60fc0f88b 100755 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ INSTALL_REQUIRES = [ 'numpy>=1.13.3', 'scipy>=0.19.1', - 'scikit-learn>=0.23', + 'scikit-learn>=0.23.2', 'joblib>=0.11' ] EXTRAS_REQUIRE = {