如何在测试集中找到错误的预测案例(使用Keras的CNN)

use*_*320 10 python machine-learning convolution theano keras

我正在使用带有60000训练图像和10000测试图像的MNIST示例.如何找到具有错误分类/预测的10000个测试图像中的哪一个?

S.M*_* sh 9

只需使用model.predict_classes()并比较输出与真实的实验.即:

incorrects = np.nonzero(model.predict_class(X_test).reshape((-1,)) != y_test)
Run Code Online (Sandbox Code Playgroud)

获得错误预测的索引