Explorar o código

generate label for mysql

罗俊辉 hai 1 ano
pai
achega
7fcea7394e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      process_data.py

+ 1 - 1
process_data.py

@@ -134,7 +134,7 @@ class SpiderProcess(object):
             des_path = "data/train_data/spider_train_{}".format(datetime.datetime.today().strftime("%Y%m%d"))
         elif flag == "predict":
             dt_time = datetime.datetime.strptime(dt_time, "%Y%m%d")
-            three_date_before = dt_time - datetime.timedelta(days=4)
+            three_date_before = dt_time + datetime.timedelta(days=4)
             temp_time = three_date_before.strftime("%Y%m%d")
             select_sql = f"""SELECT video_id, video_title, label, channel, out_user_id, spider_mode, out_play_cnt, out_like_cnt, out_share_cnt FROM lightgbm_data WHERE type = 'spider' and daily_dt_str = '{temp_time}';"""
             des_path = "data/predict_data/predict_{}.json".format(temp_time)