Skip to content

MAINT drop disutils and use scikit-learn fixes instead #1065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/whats_new/v0.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Bug fixes
`estimator` could not be a :class:`~sklearn.pipeline.Pipeline` object.
:pr:`1049` by :user:`Gonenc Mogol <gmogol>`.

Compatibility
.............

- Do not use `distutils` in tests due to deprecation.
:pr:`1065` by :user:`Michael R. Crusoe <mr-c>`

Version 0.12.0
==============

Expand Down
5 changes: 2 additions & 3 deletions imblearn/tensorflow/tests/test_generator.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from distutils.version import LooseVersion

import numpy as np
import pytest
from scipy import sparse
from sklearn.datasets import load_iris
from sklearn.utils.fixes import parse_version

from imblearn.datasets import make_imbalance
from imblearn.over_sampling import RandomOverSampler
Expand Down Expand Up @@ -147,7 +146,7 @@ def accuracy(y_true, y_pred):

@pytest.mark.parametrize("sampler", [None, NearMiss(), RandomOverSampler()])
def test_balanced_batch_generator(data, sampler):
if LooseVersion(tf.__version__) < "2":
if parse_version(tf.__version__) < parse_version("2.0.0"):
check_balanced_batch_generator_tf_1_X_X(data, sampler)
else:
check_balanced_batch_generator_tf_2_X_X_compat_1_X_X(data, sampler)
Expand Down