其他分享
首页 > 其他分享> > Keras中one-hot码的编码和解码

Keras中one-hot码的编码和解码

作者:互联网

编码

from keras.utils import to_categorical
(x_train,y_train),(x_test,y_test)= fashion_mnist.load_data()
y_train = to_categorical(y_train)

解码

np.argmax(y_train,axis=1)

标签:load,编码,categorical,解码,Keras,hot,train,test
来源: https://blog.csdn.net/CNMBNYZW2/article/details/115362030