【发布时间】:2017-05-25 06:33:26
【问题描述】:
所以我编写了一个由以下组成的网络用于多类分类: -y_labels 用 to_categorical 转换 -last 层使用 3 个神经元的 sigmoid 函数作为我的类 -model compile 使用 categorical_crossentropy 作为损失函数 所以我用了
model.predict_classes(x_test)
然后我把它当作
classification_report(y_test,pred)
y_test 的形式为 to_categorical 我收到以下错误:
ValueError: Mix type of y not allowed, got types set(['binary', 'multilabel-indicator'])
我的问题是我怎样才能将它转换回来以便这样使用它?
【问题讨论】:
标签: scikit-learn keras