Skip to content

Commit

Permalink
MAINT drop disutils and use scikit-learn fixes instead (#1065)
Browse files Browse the repository at this point in the history
Co-authored-by: Nilesh Patra <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
  • Loading branch information
3 people committed Mar 31, 2024
1 parent 27b8d6a commit cad2943
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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

0 comments on commit cad2943

Please sign in to comment.