reiinakano / scikit-plot

An intuitive library to add plotting functionality to scikit-learn objects.
MIT License
2.43k stars 285 forks source link

Add hide_zeros param to confusion matrix #39

Closed ExcaliburZero closed 7 years ago

ExcaliburZero commented 7 years ago

Add an optional parameter to the plot_confusion_matrix function to allow the hiding of zero values in the matrix in order to make the plot easier to read in cases where there are many zero values.

Here is what a confusion matrix looks like normally (hide_zeros = False)

scikit_plot_04

Here is the same confusion matrix with zeros hidden (hide_zeros = True)

scikit_plot_06

reiinakano commented 7 years ago

This looks really good!

Though one more thing before I merge. Do you mind adding this to https://github.com/reiinakano/scikit-plot/blob/master/scikitplot/classifiers.py#L56 as well? Thanks!

ExcaliburZero commented 7 years ago

Though one more thing before I merge. Do you mind adding this to https://github.com/reiinakano/scikit-plot/blob/master/scikitplot/classifiers.py#L56 as well? Thanks!

I have now added it there as well.

reiinakano commented 7 years ago

LGTM. Thanks!