2.7 Confusion matrix

In [13]:
Y_true = np.argmax(y_test,axis = 1) 
confusion_mtx = confusion_matrix(Y_true, prediction_values) 
sns.heatmap(confusion_mtx, annot=True, fmt="d")
plt.ylabel('True')
plt.xlabel('Predicted')
Out[13]:
Text(0.5, 15.0, 'Predicted')

2.8 Save a model to JSON and HDF5

In [14]:
# save weights to HDF5
model.save_weights("CNN_tf.keras_mnist.h5")