Skip to content

Commit

Permalink
Fix confusion matrix visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
adjavon committed Aug 19, 2024
1 parent d77a454 commit 878b60e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,11 @@ def cm_analysis(y_true, y_pred, title, figsize=(10,10)):
annot[i, j] = ''
else:
annot[i, j] = '%.1f%%\n%d' % (p, c)
cm = pd.DataFrame(cm, index=labels, columns=labels)
cm = pd.DataFrame(cm_perc, index=labels, columns=labels)
cm.index.name = 'Actual'
cm.columns.name = 'Predicted'
fig, ax = plt.subplots(figsize=figsize)
ax=sns.heatmap(cm, annot=annot, fmt='', vmax=30)
ax = sns.heatmap(cm, annot=annot, fmt="", vmax=100)
ax.set_title(title)

# %% [markdown]
Expand Down

0 comments on commit 878b60e

Please sign in to comment.