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