Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unreadable labels in plot_confusion_matrix in case of imbalanced data and show_normed=True #504

Merged
merged 3 commits into from
Feb 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/sources/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ The CHANGELOG for the current development version is available at

##### Bug Fixes

- Fix unreadable labels in `plot_confusion_matrix` for imbalanced datasets if `show_absolute=True` and `show_normed=True`. ([#504](https://github.com/rasbt/mlxtend/pull/504))

- Raises a more informative error if a `SparseDataFrame` is passed to `apriori` and the dataframe has integer column names that don't start with `0` due to current limitations of the `SparseDataFrame` implementation in pandas. ([#503](https://github.com/rasbt/mlxtend/pull/503))

### Version 0.15.0 (01-19-2019)
Expand Down
6 changes: 3 additions & 3 deletions mlxtend/plotting/plot_confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def plot_confusion_matrix(conf_mat,
if figsize is None:
figsize = (len(conf_mat)*1.25, len(conf_mat)*1.25)

if show_absolute:
matshow = ax.matshow(conf_mat, cmap=cmap)
else:
if show_normed:
matshow = ax.matshow(normed_conf_mat, cmap=cmap)
else:
matshow = ax.matshow(conf_mat, cmap=cmap)

if colorbar:
fig.colorbar(matshow)
Expand Down