Search⌘ K

Make Predictions

Explore how to make predictions on test and real data using a digit recognition model built with Keras. Understand the use of predict and evaluate methods, image preprocessing steps, and model loading to assess performance and interpret predictions clearly.

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:

Python
# 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:

Python
# evaluate the model's performance
loss_and_metrics = model.evaluate(X_test, Y_test)

Load the saved model using the load_model ...