What we need to see is whether or not this model can now generalize new information, which is why we reserved the testing dataset earlier. We need to generate a classification report using predictions from the model. To do this, we're going to import the classification_report and the accuracy_score features from the sklearn.metrics library. We also have to predict the values, which is very easy to do using the model.predict() function. We have to print those out and see what we have. The following lines of code show the process of testing the predictions:
# generate classification report using predictions for categorical model
from sklearn.metrics import classification_report, accuracy_score
predictions = model.predict_classes(X_test)
predictions
The preceding code snippet generates an array consisting of 1s and 0s, as shown in the following screenshot:
...