code_6.py 263 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4
cm_rfgs = confusion_matrix(y_test, y_had_rfgs) # 显示混淆矩阵
plt.figure(figsize=(4, 4))
plt.title("Random Forest (Best Score) Confusion Matrix")#随机森林(最优参数)混淆矩阵
sns.heatmap(cm_rfgs, annot=True, cmap="Blues", fmt="d", cbar=False)