Skip to content

Commit 36b7da2

Browse files
authored
Merge pull request #894 from rasbt/class-names
fix conf mat for string class names
2 parents bd4e03a + 10a9b3f commit 36b7da2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/sources/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The CHANGELOG for the current development version is available at
3535
##### Bug Fixes
3636

3737
- Fix unreadable labels in `heatmap` for certain colormaps. ([#852](https://github.com/rasbt/mlxtend/pull/852))
38+
- Fix an issue in `mlxtend.plotting.plot_confusion_matrix` when string class names are passed ([#894](https://github.com/rasbt/mlxtend/pull/894))
3839

3940

4041

mlxtend/plotting/plot_confusion_matrix.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ def plot_confusion_matrix(conf_mat,
120120
for j in range(conf_mat.shape[1]):
121121
cell_text = ""
122122
if show_absolute:
123-
cell_text += format(conf_mat[i, j], 'd')
123+
num = conf_mat[i, j].astype(np.int64)
124+
cell_text += format(num, 'd')
124125
if show_normed:
125126
cell_text += "\n" + '('
126127
cell_text += format(normed_conf_mat[i, j], '.2f') + ')'

0 commit comments

Comments
 (0)