From 3228f8ac76cd2a9f48397c5346a37a00bd8450d7 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Thu, 21 Oct 2021 10:42:39 +0200 Subject: [PATCH] MNT update import for keras --- doc/miscellaneous.rst | 2 +- imblearn/keras/tests/test_generator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/miscellaneous.rst b/doc/miscellaneous.rst index 43503abfa..4aeb4a2cf 100644 --- a/doc/miscellaneous.rst +++ b/doc/miscellaneous.rst @@ -136,7 +136,7 @@ calling ``fit_generator`` method to train the model. To illustrate, we will define a logistic regression model:: >>> import keras - >>> y = keras.utils.to_categorical(y, 3) + >>> y = keras.utils.np_utils.to_categorical(y, 3) >>> model = keras.Sequential() >>> model.add(keras.layers.Dense(y.shape[1], input_dim=X.shape[1], ... activation='softmax')) diff --git a/imblearn/keras/tests/test_generator.py b/imblearn/keras/tests/test_generator.py index 40c10b6a3..071c74364 100644 --- a/imblearn/keras/tests/test_generator.py +++ b/imblearn/keras/tests/test_generator.py @@ -8,7 +8,7 @@ keras = pytest.importorskip("keras") from keras.models import Sequential # noqa: E402 from keras.layers import Dense # noqa: E402 -from keras.utils import to_categorical # noqa: E402 +from keras.utils.np_utils import to_categorical # noqa: E402 from imblearn.datasets import make_imbalance # noqa: E402 from imblearn.under_sampling import ClusterCentroids # noqa: E402