From 651d744bd731ef17624947abcfeb14322ecd1626 Mon Sep 17 00:00:00 2001 From: wangchunlin Date: Sun, 30 Jun 2024 17:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=89=93=E5=8D=B0=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/common.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/common.py b/utils/common.py index 191fd69..b42a6c9 100644 --- a/utils/common.py +++ b/utils/common.py @@ -188,17 +188,17 @@ class MLModel: # 打印训练和验证过程的可视化图片 plt.close('all') fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(15, 5)) - ax1.plot(train_loss_history, label='Train Loss(训练损失)', fontproperties=font_prop) - ax1.plot(val_loss_history, label='Validation Loss(验证损失)', fontproperties=font_prop) + ax1.plot(train_loss_history, label='Train Loss(训练损失)') + ax1.plot(val_loss_history, label='Validation Loss(验证损失)') ax1.set_title('Loss(损失)', fontproperties=font_prop) ax1.legend() - ax2.plot(train_acc_history, label='Train Accuracy(训练正确率)', fontproperties=font_prop) - ax2.plot(val_acc_history, label='Validation Accuracy(验证正确率)', fontproperties=font_prop) + ax2.plot(train_acc_history, label='Train Accuracy(训练正确率)') + ax2.plot(val_acc_history, label='Validation Accuracy(验证正确率)') ax2.set_title('Accuracy(正确率)', fontproperties=font_prop) ax2.legend() - ax3.plot(val_f1_history, label='Validation F1(验证F1得分)', fontproperties=font_prop) - ax3.plot(val_precision_history, label='Validation Precision(验证精确率)', fontproperties=font_prop) - ax3.plot(val_recall_history, label='Validation Recall(验证召回率)', fontproperties=font_prop) + ax3.plot(val_f1_history, label='Validation F1(验证F1得分)') + ax3.plot(val_precision_history, label='Validation Precision(验证精确率)') + ax3.plot(val_recall_history, label='Validation Recall(验证召回率)') ax3.set_title('Precision Recall F1-Score (Macro Mean)(宏平均)', fontproperties=font_prop) ax3.legend() # 保存图片