February 2019
Beginner to intermediate
308 pages
7h 42m
English
We can evaluate our model on the training set and testing set using the evaluate() function:
scores = model.evaluate(X_train, y_train)print("Training Accuracy: %.2f%%\n" % (scores[1]*100))scores = model.evaluate(X_test, y_test)print("Testing Accuracy: %.2f%%\n" % (scores[1]*100))
We get the following result:

The accuracy is 91.85% and 78.57% on the training set and testing set respectively. The difference in accuracy between the training and testing set isn't surprising since the model was trained on the training set. In fact, by training the model over more iterations, we can achieve 100% accuracy on the training set, but ...
Read now
Unlock full access