March 2020
Intermediate to advanced
366 pages
9h 8m
English
Analogous to Chapter 7, Learning to Recognize Traffic Signs, we will evaluate the performance of our classifier in terms of accuracy, precision, and recall.
To reuse our previous code, we just need to calculate y_hat and pass y_true alongside it to the metric functions by doing the following:
x_test = _pca_featurize(np.array(data)[test], *pca_args)
_, predicted = mlp.predict(x_test) y_hat = np.array([index_to_label[np.argmax(y)] for y in predicte