January 2018
Intermediate to advanced
268 pages
6h 20m
English
To evaluate the robustness and accuracy of our trained MLP network, we will calculate the confusion matrix (also known as error matrix). This matrix will describe the performance of our classification model. Each row of the confusion matrix represents the instances in a predicted class, while each column represents the instances in an actual class (or vice versa). To fill up the matrix, we will use our testing set to evaluate it:
from collections import OrderedDictdef init_confusion_matrix(self, label_words): confusion_matrix = OrderedDict() for label in label_words: confusion_matrix[label] = OrderedDict() for label2 in label_words: confusion_matrix[label][label2] = 0 return confusion_matrix# Chooses the class with ...
Read now
Unlock full access