-
Notifications
You must be signed in to change notification settings - Fork 176
Open
Description
Thank you for your outstanding work, which is worth learning from me.
I have a question for you about confusion matrices.
Can you tell me how to call the function of confusion matrices and output the picture
Thank you very much!
offline_test:
def plot_cm(cm, classes, normalize = True):
import seaborn as sns
if normalize:
cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]
print("Normalized confusion matrix")
else:
print('Confusion matrix, without normalization')
ax= plt.subplot()
sns.heatmap(cm, annot=False, ax = ax); #annot=True to annotate cells
# labels, title and ticks
ax.set_xlabel('Predicted labels');ax.set_ylabel('True labels');
plt.xticks(rotation='vertical')
plt.yticks(rotation='horizontal')
Thank you very much!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels