May 2020
Intermediate to advanced
404 pages
10h 52m
English
After training the model, we are now ready to evaluate its accuracy. To do so, we will use the following code:
score = model.evaluate(x_test, y_test, verbose=1)print('Test loss:', score[0])print('Test accuracy:', score[1])
We will get the following output for the preceding code:

We get 99% accuracy, which is a very good accuracy score. Now, we can save the model, which will be used in the future to make predictions for user input through the web portal. We will split the model into two parts—the model structure and the model weights. To save the structure, we will use the JSON format, as shown:
model_json = ...
Read now
Unlock full access