From 5cbc92f582692a69866bd7e9232da3aa1def5219 Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 15:13:18 +0000 Subject: [PATCH 01/13] bumping required sklearn version to 1.2.1 --- imblearn/_min_dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imblearn/_min_dependencies.py b/imblearn/_min_dependencies.py index aaa5ce9ae..83a9b6114 100644 --- a/imblearn/_min_dependencies.py +++ b/imblearn/_min_dependencies.py @@ -4,7 +4,7 @@ NUMPY_MIN_VERSION = "1.17.3" SCIPY_MIN_VERSION = "1.3.2" PANDAS_MIN_VERSION = "1.0.5" -SKLEARN_MIN_VERSION = "1.0.2" +SKLEARN_MIN_VERSION = "1.2.1" TENSORFLOW_MIN_VERSION = "2.4.3" KERAS_MIN_VERSION = "2.4.3" JOBLIB_MIN_VERSION = "1.1.1" From 635abd3b77001d495f5eecd41e07a35a35d26d5b Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 15:14:25 +0000 Subject: [PATCH 02/13] changing imports --- imblearn/ensemble/_forest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imblearn/ensemble/_forest.py b/imblearn/ensemble/_forest.py index 4714b703a..56c2a23cb 100644 --- a/imblearn/ensemble/_forest.py +++ b/imblearn/ensemble/_forest.py @@ -9,7 +9,7 @@ import numpy as np import sklearn -from joblib import Parallel +from sklearn.utils.parallel import Parallel from numpy import float32 as DTYPE from numpy import float64 as DOUBLE from scipy.sparse import issparse @@ -24,7 +24,7 @@ from sklearn.exceptions import DataConversionWarning from sklearn.tree import DecisionTreeClassifier from sklearn.utils import _safe_indexing, check_random_state, parse_version -from sklearn.utils.fixes import delayed +from sklearn.utils.parallel import delayed from sklearn.utils.multiclass import type_of_target from sklearn.utils.validation import _check_sample_weight From be38ca6e45c8d4309862ed6266efee854506df63 Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 20:08:11 +0200 Subject: [PATCH 03/13] running isort --- imblearn/ensemble/_forest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/imblearn/ensemble/_forest.py b/imblearn/ensemble/_forest.py index 56c2a23cb..a454f81a5 100644 --- a/imblearn/ensemble/_forest.py +++ b/imblearn/ensemble/_forest.py @@ -9,7 +9,6 @@ import numpy as np import sklearn -from sklearn.utils.parallel import Parallel from numpy import float32 as DTYPE from numpy import float64 as DOUBLE from scipy.sparse import issparse @@ -24,8 +23,8 @@ from sklearn.exceptions import DataConversionWarning from sklearn.tree import DecisionTreeClassifier from sklearn.utils import _safe_indexing, check_random_state, parse_version -from sklearn.utils.parallel import delayed from sklearn.utils.multiclass import type_of_target +from sklearn.utils.parallel import Parallel, delayed from sklearn.utils.validation import _check_sample_weight from ..base import _ParamsValidationMixin From 7198f3875bb54f33c8d9e2b6c0a7ae683e6e9775 Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 20:22:17 +0200 Subject: [PATCH 04/13] updating min_version to scikit-learn min values --- imblearn/_min_dependencies.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imblearn/_min_dependencies.py b/imblearn/_min_dependencies.py index 83a9b6114..c0403d6f6 100644 --- a/imblearn/_min_dependencies.py +++ b/imblearn/_min_dependencies.py @@ -2,14 +2,14 @@ import argparse NUMPY_MIN_VERSION = "1.17.3" -SCIPY_MIN_VERSION = "1.3.2" +SCIPY_MIN_VERSION = "1.5.0" PANDAS_MIN_VERSION = "1.0.5" SKLEARN_MIN_VERSION = "1.2.1" TENSORFLOW_MIN_VERSION = "2.4.3" KERAS_MIN_VERSION = "2.4.3" JOBLIB_MIN_VERSION = "1.1.1" THREADPOOLCTL_MIN_VERSION = "2.0.0" -PYTEST_MIN_VERSION = "5.0.1" +PYTEST_MIN_VERSION = "5.3.1" # 'build' and 'install' is included to have structured metadata for CI. # It will NOT be included in setup's extras_require From ece474c08fcd9972dbeefdde2e007a089eb4d00e Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 20:35:03 +0200 Subject: [PATCH 05/13] updating min_version --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index bfebdd8d6..813751d95 100644 --- a/README.rst +++ b/README.rst @@ -29,14 +29,14 @@ .. |PythonMinVersion| replace:: 3.8 .. |NumPyMinVersion| replace:: 1.17.3 -.. |SciPyMinVersion| replace:: 1.3.2 -.. |ScikitLearnMinVersion| replace:: 1.0.2 +.. |SciPyMinVersion| replace:: 1.5.0 +.. |ScikitLearnMinVersion| replace:: 1.2.1 .. |MatplotlibMinVersion| replace:: 3.1.2 .. |PandasMinVersion| replace:: 1.0.5 .. |TensorflowMinVersion| replace:: 2.4.3 .. |KerasMinVersion| replace:: 2.4.3 .. |SeabornMinVersion| replace:: 0.9.0 -.. |PytestMinVersion| replace:: 5.0.1 +.. |PytestMinVersion| replace:: 5.3.1 imbalanced-learn ================ From 0a3b981a575f45bb7f50e25764b88b08cb2914b4 Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 20:56:32 +0200 Subject: [PATCH 06/13] updating numpy min_version to 1.23.5 --- README.rst | 2 +- imblearn/_min_dependencies.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 813751d95..6320d2924 100644 --- a/README.rst +++ b/README.rst @@ -28,7 +28,7 @@ .. _Black: :target: https://github.com/psf/black .. |PythonMinVersion| replace:: 3.8 -.. |NumPyMinVersion| replace:: 1.17.3 +.. |NumPyMinVersion| replace:: 1.23.5 .. |SciPyMinVersion| replace:: 1.5.0 .. |ScikitLearnMinVersion| replace:: 1.2.1 .. |MatplotlibMinVersion| replace:: 3.1.2 diff --git a/imblearn/_min_dependencies.py b/imblearn/_min_dependencies.py index c0403d6f6..9c8f109be 100644 --- a/imblearn/_min_dependencies.py +++ b/imblearn/_min_dependencies.py @@ -1,7 +1,7 @@ """All minimum dependencies for imbalanced-learn.""" import argparse -NUMPY_MIN_VERSION = "1.17.3" +NUMPY_MIN_VERSION = "1.23.5" SCIPY_MIN_VERSION = "1.5.0" PANDAS_MIN_VERSION = "1.0.5" SKLEARN_MIN_VERSION = "1.2.1" From f7ea84fa779023f3f0c330634f44246b2114783a Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 21:06:32 +0200 Subject: [PATCH 07/13] Require scikit-learn >= 1.2.2 --- README.rst | 2 +- imblearn/_min_dependencies.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 6320d2924..3158188b9 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ .. |PythonMinVersion| replace:: 3.8 .. |NumPyMinVersion| replace:: 1.23.5 .. |SciPyMinVersion| replace:: 1.5.0 -.. |ScikitLearnMinVersion| replace:: 1.2.1 +.. |ScikitLearnMinVersion| replace:: 1.2.2 .. |MatplotlibMinVersion| replace:: 3.1.2 .. |PandasMinVersion| replace:: 1.0.5 .. |TensorflowMinVersion| replace:: 2.4.3 diff --git a/imblearn/_min_dependencies.py b/imblearn/_min_dependencies.py index 9c8f109be..f9e34a990 100644 --- a/imblearn/_min_dependencies.py +++ b/imblearn/_min_dependencies.py @@ -4,7 +4,7 @@ NUMPY_MIN_VERSION = "1.23.5" SCIPY_MIN_VERSION = "1.5.0" PANDAS_MIN_VERSION = "1.0.5" -SKLEARN_MIN_VERSION = "1.2.1" +SKLEARN_MIN_VERSION = "1.2.2" TENSORFLOW_MIN_VERSION = "2.4.3" KERAS_MIN_VERSION = "2.4.3" JOBLIB_MIN_VERSION = "1.1.1" From 0c81661e1955762769b8fd3b6f24c57a9d1b7298 Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 21:21:38 +0200 Subject: [PATCH 08/13] Require SciPyMinVersion >= 1.5.1 (numpy.int is deprecated) --- README.rst | 2 +- imblearn/_min_dependencies.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 3158188b9..5118eab82 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ .. |PythonMinVersion| replace:: 3.8 .. |NumPyMinVersion| replace:: 1.23.5 -.. |SciPyMinVersion| replace:: 1.5.0 +.. |SciPyMinVersion| replace:: 1.5.1 .. |ScikitLearnMinVersion| replace:: 1.2.2 .. |MatplotlibMinVersion| replace:: 3.1.2 .. |PandasMinVersion| replace:: 1.0.5 diff --git a/imblearn/_min_dependencies.py b/imblearn/_min_dependencies.py index f9e34a990..e986fae16 100644 --- a/imblearn/_min_dependencies.py +++ b/imblearn/_min_dependencies.py @@ -2,7 +2,7 @@ import argparse NUMPY_MIN_VERSION = "1.23.5" -SCIPY_MIN_VERSION = "1.5.0" +SCIPY_MIN_VERSION = "1.5.1" PANDAS_MIN_VERSION = "1.0.5" SKLEARN_MIN_VERSION = "1.2.2" TENSORFLOW_MIN_VERSION = "2.4.3" From df705f936f13f251fa1cc32840d44ca2326d5b93 Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 21:37:19 +0200 Subject: [PATCH 09/13] Change of type: class -> proportion --- doc/common_pitfalls.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/common_pitfalls.rst b/doc/common_pitfalls.rst index a08999a14..e65679d98 100644 --- a/doc/common_pitfalls.rst +++ b/doc/common_pitfalls.rst @@ -56,7 +56,7 @@ Let's first check the balancing ratio on this dataset:: >>> y.value_counts(normalize=True) <=50K 0.98801 >50K 0.01199 - Name: class, dtype: float64 + Name: proportion, dtype: float64 To later highlight some of the issue, we will keep aside a left-out set that we will not use for the evaluation of the model:: From 068d9b77fa9b5fa0098284c29e7e5127fb876580 Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 21:39:45 +0200 Subject: [PATCH 10/13] Updating _easy_ensemble.py imports --- imblearn/ensemble/_easy_ensemble.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/imblearn/ensemble/_easy_ensemble.py b/imblearn/ensemble/_easy_ensemble.py index 2ec31e55d..8d210d91f 100644 --- a/imblearn/ensemble/_easy_ensemble.py +++ b/imblearn/ensemble/_easy_ensemble.py @@ -10,12 +10,11 @@ import warnings import numpy as np -from joblib import Parallel from sklearn.base import clone from sklearn.ensemble import AdaBoostClassifier, BaggingClassifier from sklearn.ensemble._bagging import _parallel_decision_function from sklearn.ensemble._base import _partition_estimators -from sklearn.utils.fixes import delayed +from sklearn.utils.parallel import Parallel, delayed from sklearn.utils.validation import check_is_fitted from ..base import _ParamsValidationMixin From 2fc8b265dc71c3a80e8b2618a8dbca93fe3b6451 Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 21:50:01 +0200 Subject: [PATCH 11/13] Scipy 1.5.1 causes installation errors in conda --- README.rst | 2 +- imblearn/_min_dependencies.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 5118eab82..d1745d031 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ .. |PythonMinVersion| replace:: 3.8 .. |NumPyMinVersion| replace:: 1.23.5 -.. |SciPyMinVersion| replace:: 1.5.1 +.. |SciPyMinVersion| replace:: 1.5.2 .. |ScikitLearnMinVersion| replace:: 1.2.2 .. |MatplotlibMinVersion| replace:: 3.1.2 .. |PandasMinVersion| replace:: 1.0.5 diff --git a/imblearn/_min_dependencies.py b/imblearn/_min_dependencies.py index e986fae16..9fa811468 100644 --- a/imblearn/_min_dependencies.py +++ b/imblearn/_min_dependencies.py @@ -2,7 +2,7 @@ import argparse NUMPY_MIN_VERSION = "1.23.5" -SCIPY_MIN_VERSION = "1.5.1" +SCIPY_MIN_VERSION = "1.5.2" PANDAS_MIN_VERSION = "1.0.5" SKLEARN_MIN_VERSION = "1.2.2" TENSORFLOW_MIN_VERSION = "2.4.3" From 9db990c6d150e67a45bd095215d931f91c01ec93 Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 22:02:32 +0200 Subject: [PATCH 12/13] Updating imports in _bagging.py --- imblearn/ensemble/_bagging.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/imblearn/ensemble/_bagging.py b/imblearn/ensemble/_bagging.py index e35343f27..705a9e101 100644 --- a/imblearn/ensemble/_bagging.py +++ b/imblearn/ensemble/_bagging.py @@ -10,13 +10,12 @@ import warnings import numpy as np -from joblib import Parallel from sklearn.base import clone from sklearn.ensemble import BaggingClassifier from sklearn.ensemble._bagging import _parallel_decision_function from sklearn.ensemble._base import _partition_estimators from sklearn.tree import DecisionTreeClassifier -from sklearn.utils.fixes import delayed +from sklearn.utils.parallel import Parallel, delayed from sklearn.utils.validation import check_is_fitted from ..base import _ParamsValidationMixin From 30f92436a67c379e88bf9f0589178a0c956a796a Mon Sep 17 00:00:00 2001 From: "Christian W. Feldmann" Date: Mon, 24 Apr 2023 22:07:14 +0200 Subject: [PATCH 13/13] Updating expected output of y.value_counts in common_pitfalls.rst --- doc/common_pitfalls.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/common_pitfalls.rst b/doc/common_pitfalls.rst index e65679d98..1db13c5c0 100644 --- a/doc/common_pitfalls.rst +++ b/doc/common_pitfalls.rst @@ -54,6 +54,7 @@ increase the effect of the wrongdoings:: Let's first check the balancing ratio on this dataset:: >>> y.value_counts(normalize=True) + class <=50K 0.98801 >50K 0.01199 Name: proportion, dtype: float64