From 53b30ab7a7b431814d9f5140db978f5942c55823 Mon Sep 17 00:00:00 2001 From: workpc Date: Fri, 20 Dec 2024 10:49:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E4=B8=BAis=5Ffivemodels?= =?UTF-8?q?=E4=B8=BA=E7=9C=9F=EF=BC=8C=E4=B8=8D=E4=BF=AE=E6=94=B9=E6=9C=80?= =?UTF-8?q?=E4=BD=B3=E6=A8=A1=E5=9E=8B=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/nerulforcastmodels.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/models/nerulforcastmodels.py b/models/nerulforcastmodels.py index 48252d4..f91f215 100644 --- a/models/nerulforcastmodels.py +++ b/models/nerulforcastmodels.py @@ -274,8 +274,11 @@ def model_losss(sqlitedb,end_time): # 保存5个最佳模型的名称 if len(modelnames) > 5: modelnames = modelnames[0:5] - with open(os.path.join(dataset,"best_modelnames.txt"), 'w') as f: - f.write(','.join(modelnames) + '\n') + if is_fivemodels: + pass + else: + with open(os.path.join(dataset,"best_modelnames.txt"), 'w') as f: + f.write(','.join(modelnames) + '\n') # 预测值与真实值对比图 plt.rcParams['font.sans-serif'] = ['SimHei']