python - How can I plot a multi-class confusion matrix? -
i trying plot confusion matrix topic classification. however, when plot it, can't see clearly. scribbled x , y axis without plotted. how can plot in better way see how documents being classified? have 22465 documents , 88 topics.
here code:
from pandas_confusion import confusionmatrix import matplotlib.pyplot plt model = logisticregression() model = model.fit(matrix_tmp, label_tmp) pred = model.predict(matrix_tmp_test) print(metrics.accuracy_score(label_tmp_test,pred)) print(metrics.classification_report(label_tmp_test,pred)) cm=confusionmatrix(label_tmp_test,pred) print(cm) cm.plot() plt.show()
Comments
Post a Comment