Last active
June 28, 2019 03:11
-
-
Save spidezad/29ab9555db9238253cc720f33435d94c to your computer and use it in GitHub Desktop.
One hot Encoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.utils import np_utils | |
from sklearn.preprocessing import LabelEncoder | |
labelenc = LabelEncoder() | |
y_enc = labelenc.fit_transform(y) | |
y_onehot = np_utils.to_categorical(y_enc) | |
y_onehot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment