How to find wrong prediction cases in test set (CNNs using Keras)

user3796320 picture user3796320 · Sep 2, 2016 · Viewed 7.9k times · Source

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?

Answer

S.Mohsen sh picture S.Mohsen sh · Sep 3, 2016

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)

to get indices of incorrect predictions