Make Predictions

Make predictions on the test data and evaluate the MNIST model’s performance.

Predictions on test data

Make predictions on test data and evaluate the model’s performance.

The predict method

The predict method takes in the testing features and predicts the labels:

Press + to interact
# make probability predictions with the model
predictions = model.predict(X_test)

The evaluate method

The method can take test features and labels as arguments to evaluates the model’s performance:

Press + to interact
# evaluate the model's performance
loss_and_metrics = model.evaluate(X_test, Y_test)

Load the saved model ...

Access this course and 1400+ top-rated courses and projects.