如何在测试集中找到错误的预测案例(使用Keras的CNN) [英] How to find wrong prediction cases in test set (CNNs using Keras)

查看:113
本文介绍了如何在测试集中找到错误的预测案例(使用Keras的CNN)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是MNIST示例,其中包含60000个训练图像和10000个测试图像.如何找到10000个测试图像中哪个分类/预测不正确?

I'm using MNIST example with 60000 training image and 10000 testing image. How do I find which of the 10000 testing image that has an incorrect classification/prediction?

推荐答案

只需使用model.predict_classes()并将输出与真实标签进行比较.即:

Simply use model.predict_classes() and compare the output with true labes. i.e:

incorrects = np.nonzero(model.predict_class(X_test).reshape((-1,)) != y_test)

获取错误预测的索引

这篇关于如何在测试集中找到错误的预测案例(使用Keras的CNN)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆