Skip to content

Commit 65a0d22

Browse files
authored
Merge pull request #172 from cognitive-catalyst/sue-branch
Fix warning on confusion matrix DCO 1.1 Signed-off-by: Sue S Schmidt sueschm@us.ibm.com
2 parents 671d955 + b5c4ec8 commit 65a0d22

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/confusionmatrix.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ def func(args):
5454
#Plot a normalized confusion matrix as a heatmap
5555
plt.figure(figsize = (10,10))
5656
df_cm = pd.DataFrame(output_matrix, index=index_labels, columns=column_labels)
57+
df_cm = df_cm.to_numpy()
5758
df_cm = df_cm.astype('float') / df_cm.sum(axis=1)[:, np.newaxis]
5859
sns.set(font_scale=1)
5960
# Add 'annot=True' to the list of options for heatmap if you want to print the numbers, ideal only for small maps
60-
hm = sns.heatmap(df_cm, cmap="Greys",cbar=False,fmt='.1%',linewidths=0.1,linecolor='black')
61+
hm = sns.heatmap(df_cm, cmap="Greys",cbar=False,fmt='.1%',linewidths=0.1,linecolor='black',xticklabels=column_labels, yticklabels=index_labels)
6162
hm.set_yticklabels(hm.get_yticklabels(), rotation=0)
6263
hm.set_xticklabels(hm.get_xticklabels(), rotation=90)
6364
plt.title("Normalized Confusion Matrix")

0 commit comments

Comments
 (0)