WIP : Matplotlib confusion matrix plot has issues

isaac
Pavan Mandava 5 years ago
parent d18593f869
commit 52efebe53e

@ -172,7 +172,7 @@ def get_confusion_matrix(y_true, y_pred):
:param y_pred: Predicted labels
:return: returns Confusion Matrix
"""
return confusion_matrix(y_true, y_pred, const.CLASS_LABELS_LIST)
return confusion_matrix(y_true, y_pred, labels=const.CLASS_LABELS_LIST)
def plot_confusion_matrix(confusion_mat, classifier_name):
@ -182,6 +182,7 @@ def plot_confusion_matrix(confusion_mat, classifier_name):
:param classifier_name: Classifier Name to show it on the Top
"""
fig, ax = plt.subplots(2, 2)
plt.show()
ax.matshow(confusion_mat, cmap='Greens')
for x in (0, 2):
for y in (0, 2):

@ -9,4 +9,4 @@ confusion_matrix = metrics.get_confusion_matrix(y_true, y_pred)
print(confusion_matrix)
metrics.plot_confusion_matrix(confusion_matrix, "BiLSTM Classifier + Attention with ELMo")
# metrics.plot_confusion_matrix(confusion_matrix, "BiLSTM Classifier + Attention with ELMo")

Loading…
Cancel
Save