From 636c6cdc1420276667cab88a9f74f122428f5c5e Mon Sep 17 00:00:00 2001 From: workpc Date: Wed, 11 Dec 2024 16:53:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=80=BB=E8=BE=91=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8E=BB=E6=8E=89=E7=9B=B8=E5=85=B3=E6=80=A7=E5=B0=8F?= =?UTF-8?q?=E4=BA=8E0.6=E7=9A=84=E7=89=B9=E5=BE=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config_jingbo.py | 4 ++-- lib/dataread.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config_jingbo.py b/config_jingbo.py index 28fde4c..13e9c42 100644 --- a/config_jingbo.py +++ b/config_jingbo.py @@ -232,8 +232,8 @@ is_fivemodels = False # 是否使用之前保存的最佳的5个模型 is_edbcode = False # 特征使用edbcoding列表中的 is_edbnamelist = False # 自定义特征,对应上面的edbnamelist is_update_eta = False # 预测结果上传到eta -is_update_report = True # 是否上传报告 -is_update_warning_data = True # 是否上传预警数据 +is_update_report = False # 是否上传报告 +is_update_warning_data = False # 是否上传预警数据 # 连接到数据库 diff --git a/lib/dataread.py b/lib/dataread.py index 09b4e59..93c4472 100644 --- a/lib/dataread.py +++ b/lib/dataread.py @@ -652,7 +652,7 @@ def check_column(df,col_name,two_months_ago): ''' if 'ds' in col_name or 'y' in col_name: return False - df_check_column = df[['ds',col_name]] + df_check_column = df[['ds',col_name,'y']] df_check_column = df_check_column.dropna() if len(df_check_column) == 0: @@ -662,6 +662,12 @@ def check_column(df,col_name,two_months_ago): if df_check_column[(df_check_column['ds']>= two_months_ago)].groupby(col_name).ngroups < 2: print(f'180没有更新:{col_name}') return True + + # 判断相关系数大于0.6 + if abs(df_check_column[col_name].corr(df_check_column['y'])) < 0.6: + print(f'相关系数小于0.6:{col_name}') + return True + corresponding_date = df_check_column.iloc[-1]['ds'] return corresponding_date < two_months_ago