Seaboarnでheatmapを表示させた時の数字を1.5e+02→150に変更[Python]
修正前
import matplotlib.pyplot as plt
import seaborn as sns
confusion = calc_confusion(all_prediction["A"], all_prediction["B"])
df = pd.DataFrame(data=confusion, index=['0', '1', '2', '3'], columns=['0', '1', '2', '3'])
plt.figure()
sns.heatmap(confusion, annot=True)
plt.xlabel('A')
plt.ylabel('B')

修正後
sns.heatmapの引数にfmt='d'を与えた.
import matplotlib.pyplot as plt
import seaborn as sns
confusion = calc_confusion(all_prediction["A"], all_prediction["B"])
df = pd.DataFrame(data=confusion, index=['0', '1', '2', '3'], columns=['0', '1', '2', '3'])
plt.figure()
sns.heatmap(confusion, annot=True, fmt='d')
plt.xlabel('A')
plt.ylabel('B')







ディスカッション
コメント一覧
まだ、コメントがありません