2.5 Evaluate the model to see the accuracy

Now we can check the accuracy of our model

In [12]:
print("Evaluating on training set...")
(loss, accuracy) = model.evaluate(X_train, y_train.T)
print("loss={:.4f}, accuracy: {:.4f}%".format(loss,accuracy * 100))

print("Evaluating on testing set...")
(loss, accuracy) = model.evaluate(X_test, y_test.T)
print("loss={:.4f}, accuracy: {:.4f}%".format(loss,accuracy * 100))
Evaluating on training set...
2000/2000 [==============================] - 0s 30us/step
loss=0.0028, accuracy: 100.0000%
Evaluating on testing set...
1000/1000 [==============================] - 0s 34us/step
loss=0.0028, accuracy: 100.0000%