July 2018
Beginner to intermediate
406 pages
9h 55m
English
With multiclass problems, we shouldn't just be interested in how well we manage to correctly classify the genres. We should also look into which genres we confuse with each other. This can be done with the appropriately named confusion matrix, which you may have noticed is part of the training procedure:
>>> cm = confusion_matrix(y_test, y_pred)
If we print out the confusion matrix, we would see something like the following:
[[26 1 2 0 0 2] [ 4 7 5 0 5 3] [ 1 2 14 2 8 3] [ 5 4 7 3 7 5] [ 0 0 10 2 10 12] [ 1 0 4 0 13 12]]
This is the distribution of labels that the classifier predicted for the test set for every genre. The diagonal represents the correct classifications. ...
Read now
Unlock full access