Browse Source

更新初始化代码

罗俊辉 1 year ago
parent
commit
1661383a05
1 changed files with 8 additions and 8 deletions
  1. 8 8
      main.py

+ 8 - 8
main.py

@@ -42,7 +42,7 @@ float_cols = [
         "out_share_cnt",
         "out_collection_cnt"
     ]
-with open("whole_data/x_data_total_return.json") as f1:
+with open("whole_data/x_data_3day_up_level.json") as f1:
     x_list = json.loads(f1.read())
     print(len(x_list))
     index_t = int(len(x_list) * 0.7)
@@ -60,15 +60,15 @@ with open("whole_data/x_data_total_return.json") as f1:
 print("读取X数据成功!")
 
 
-with open("whole_data/y_data_total_return.json") as f2:
+with open("whole_data/y_data_3day_up_level.json") as f2:
     y_list = json.loads(f2.read())
-    print(len(y_list))
+    # print(len(y_list))
     index_t = int(len(y_list) * 0.7)
-    temp = sorted(y_list)
-    yuzhi = temp[int(len(temp) * 0.8)-1]
-    y__list = [0 if i <= yuzhi else 1 for i in y_list]
-    y_train = np.array(y__list[:index_t])
-    y_test = np.array(y__list[index_t:])
+    # temp = sorted(y_list)
+    # yuzhi = temp[int(len(temp) * 0.8)-1]
+    # y__list = [0 if i <= yuzhi else 1 for i in y_list]
+    y_train = np.array(y_list[:index_t])
+    y_test = np.array(y_list[index_t:])
 
 print("读取Y数据成功!")