python - Is it possible to plot a confusion matrix with 90 classes? -
i wish plot confusion matrix classification model. has 20000 documents need classified 90 classes. confusion matrix receive huge. wish plot seem find binary classification plots everywhere. possible plot multi-class confusion matrix? tried methods does't display clear one.
this how confusion matrix looks like:
[[3919 344 0 ..., 0 0 1] [ 267 2739 0 ..., 0 0 0] [ 1 6 17 ..., 0 0 0] ..., [ 4 1 0 ..., 6 0 0] [ 0 2 0 ..., 0 0 0] [ 6 1 0 ..., 0 0 15]]
here sample code using matplotlib (edit: added grid , switching off interpolation)
import numpy np import matplotlib.pyplot plt confmat=np.random.rand(90,90) ticks=np.linspace(0, 89,num=90) plt.imshow(confmat, interpolation='none') plt.colorbar() plt.xticks(ticks,fontsize=6) plt.yticks(ticks,fontsize=6) plt.grid(true) plt.show()
Comments
Post a Comment