在我的代碼中,我正在繪制準確度曲線圖和混淆矩陣熱圖。但是: 1- 我將兩個圖都放在一個上(下圖) 2- 為什么數字會這樣變化?在我的熱圖中,我需要數字和百分比。

代碼
display = confusion_matrix(y_test, y_pred)
print(display)
sns.heatmap(display, annot=True,cbar_kws={'format':PercentFormatter()}, cmap='Blues')
"""
Plot of Model Accuracy on Train and Validation Datasets
"""
plt.plot(history.history['accuracy'])
plt.plot(history.history['val_accuracy'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'val'], loc='upper left')
plt.show()
uj5u.com熱心網友回復:
在這一行之后:
sns.heatmap(display, annot=True,cbar_kws={'format':PercentFormatter()}, cmap='Blues')
添加新行:
plt.show()
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/427797.html
