Browse Source

更新初始化代码

罗俊辉 1 year ago
parent
commit
4f3e29b6b4
1 changed files with 5 additions and 5 deletions
  1. 5 5
      main.py

+ 5 - 5
main.py

@@ -64,11 +64,11 @@ with open("whole_data/y_data_total_return.json") as f2:
     y_list = json.loads(f2.read())
     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数据成功!")