Added plot.show(block = True)

isaac
Pavan Mandava 5 years ago
parent 3089662a0a
commit 244e27bee6

@ -179,9 +179,6 @@ def get_confusion_matrix(y_true, y_pred):
def plot_confusion_matrix(confusion_mat, classifier_name): def plot_confusion_matrix(confusion_mat, classifier_name):
accuracy = np.trace(confusion_mat) / float(np.sum(confusion_mat))
mis_class = 1 - accuracy
plt.figure(figsize=(8, 6)) plt.figure(figsize=(8, 6))
plt.imshow(confusion_mat, interpolation='nearest', cmap=plt.get_cmap('Blues')) plt.imshow(confusion_mat, interpolation='nearest', cmap=plt.get_cmap('Blues'))
plt.title(classifier_name) plt.title(classifier_name)
@ -201,8 +198,8 @@ def plot_confusion_matrix(confusion_mat, classifier_name):
plt.tight_layout() plt.tight_layout()
plt.ylabel('True/Gold') plt.ylabel('True/Gold')
plt.xlabel('Predicted \nAccuracy={:0.4f}; misclass={:0.4f}'.format(accuracy, mis_class)) plt.xlabel('Predicted')
plt.show() plt.show(block=True)
class Result: class Result:

Loading…
Cancel
Save