Browse Source

预测代码

罗俊辉 1 year ago
parent
commit
20f81290b2
1 changed files with 5 additions and 5 deletions
  1. 5 5
      process_data.py

+ 5 - 5
process_data.py

@@ -46,15 +46,15 @@ def generate_train_label(item, y_ori_data, cate):
 
 
 if __name__ == '__main__':
-    x_path = 'data/hour_train.json'
-    y_path = 'data/daily-label-20240101-20240320.json'
+    x_path = 'prid-data/train_0314_0317.json'
+    y_path = 'data/daily-label-20240315-20240321.json'
 
     with open(x_path) as f:
         x_data = json.loads(f.read())
 
     with open(y_path) as f:
         y_data = json.loads(f.read())
-    cate_list = ['total_return', '3day_up_level', 'total_view', 'total_share']
+    cate_list = ['total_return']
     for c in cate_list:
         x_list = []
         y_list = []
@@ -64,8 +64,8 @@ if __name__ == '__main__':
             x_list.append(features)
             y_list.append(our_label)
         # print(len(y_list))
-        with open("whole_data/x_data_{}.json".format(c), "w") as f1:
+        with open("whole_data/x_data_{}_prid.json".format(c), "w") as f1:
             f1.write(json.dumps(x_list, ensure_ascii=False))
 
-        with open("whole_data/y_data_{}.json".format(c), "w") as f2:
+        with open("whole_data/y_data_{}_prid.json".format(c), "w") as f2:
             f2.write(json.dumps(y_list, ensure_ascii=False))