Skip to content

Commit 3228f8a

Browse files
committed
MNT update import for keras
1 parent 58f4a11 commit 3228f8a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/miscellaneous.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ calling ``fit_generator`` method to train the model. To illustrate, we will
136136
define a logistic regression model::
137137

138138
>>> import keras
139-
>>> y = keras.utils.to_categorical(y, 3)
139+
>>> y = keras.utils.np_utils.to_categorical(y, 3)
140140
>>> model = keras.Sequential()
141141
>>> model.add(keras.layers.Dense(y.shape[1], input_dim=X.shape[1],
142142
... activation='softmax'))

imblearn/keras/tests/test_generator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
keras = pytest.importorskip("keras")
99
from keras.models import Sequential # noqa: E402
1010
from keras.layers import Dense # noqa: E402
11-
from keras.utils import to_categorical # noqa: E402
11+
from keras.utils.np_utils import to_categorical # noqa: E402
1212

1313
from imblearn.datasets import make_imbalance # noqa: E402
1414
from imblearn.under_sampling import ClusterCentroids # noqa: E402

0 commit comments

Comments
 (0)