SearchโŒ˜ K

Solution Review: Building the Network

Explore how to build and evaluate a digit recognition model using the MNIST dataset in Keras. Learn to load saved models, use the predict and evaluate methods, and preprocess images for real data predictions. This lesson guides you through making predictions on test and real data, teaching you key skills in deep learning model deployment.

Predictions on test data

Make predictions on test data and evaluate the model 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 and 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 ...