Browse Source

186 个股 196大盘

yufeng 4 years ago
parent
commit
b0e805f3d2

BIN
mix/186_18d_mix_6D_ma5_s_seq.h5


BIN
mix/196_18d_mix_6D_ma5_s_seq.h5


+ 2 - 1
mix/mix_predict_200.py

@@ -90,7 +90,8 @@ def predict(file_path='', model_path='15min_dnn_seq.h5', idx=-1, row=18, col=20)
90 90
 
91 91
 if __name__ == '__main__':
92 92
     # predict(file_path='D:\\data\\quantization\\stock181_18d_test.log', model_path='181_18d_mix_6D_ma5_s_seq.h5')
93
-    predict(file_path='D:\\data\\quantization\\stock201_18d_train1.log', model_path='213_18d_mix_6D_ma5_s_seq.h5', row=18, col=20)
93
+    # predict(file_path='D:\\data\\quantization\\stock201_18d_train1.log', model_path='213_18d_mix_6D_ma5_s_seq.h5', row=18, col=20)
94
+    predict(file_path='D:\\data\\quantization\\stock301_18d_train1.log', model_path='301_18d_mix_6D_ma5_s_seq.h5', row=30, col=20)
94 95
     # predict(file_path='D:\\data\\quantization\\stock6_test.log', model_path='15m_dnn_seq.h5')
95 96
     # multi_predict(model='15_18d')
96 97
     # predict_today(20200229, model='11_18d')

+ 5 - 2
mix/mix_train_190.py

@@ -76,8 +76,11 @@ train_x_c = train_x[:,18*18:]
76 76
 def create_mlp(dim, regress=False):
77 77
     # define our MLP network
78 78
     model = Sequential()
79
-    model.add(Dense(96, input_dim=dim, activation="relu"))
80
-    model.add(Dense(96, activation="relu"))
79
+    model.add(Dense(256, input_dim=dim, activation="relu"))
80
+    model.add(Dropout(0.2))
81
+    model.add(Dense(256, activation="relu"))
82
+    model.add(Dense(256, activation="relu"))
83
+    model.add(Dense(128, activation="relu"))
81 84
 
82 85
     # check to see if the regression node should be added
83 86
     if regress:

+ 13 - 12
mix/mix_train_300.py

@@ -18,16 +18,16 @@ from keras.callbacks import EarlyStopping
18 18
 
19 19
 early_stopping = EarlyStopping(monitor='accuracy', patience=5, verbose=2)
20 20
 
21
-epochs= 8
22
-size = 10000 #18W 60W
23
-file_path = 'D:\\data\\quantization\\stock300_18d_train2.log'
24
-model_path = '300_18d_mix_6D_ma5_s_seq.h5'
25
-file_path1='D:\\data\\quantization\\stock300_18d_test.log'
26
-col = 18
21
+epochs= 88
22
+size = 400000 #18W 60W
23
+file_path = 'D:\\data\\quantization\\stock302_18d_train2.log'
24
+model_path = '302_18d_mix_6D_ma5_s_seq.h5'
25
+file_path1='D:\\data\\quantization\\stock302_18d_test.log'
26
+col = 20
27 27
 '''
28
-ROC     30*18
29
-DMI     30*20
30
-MACD    30*19
28
+ROC     30*18           38,100,17
29
+DMI     30*20           39,101,13
30
+MACD    30*19           
31 31
 RSI     30*17
32 32
 
33 33
 '''
@@ -77,8 +77,10 @@ train_x_c = train_x[:,30*col:]
77 77
 def create_mlp(dim, regress=False):
78 78
     # define our MLP network
79 79
     model = Sequential()
80
-    model.add(Dense(128, input_dim=dim, activation="relu"))
80
+    model.add(Dense(256, input_dim=dim, activation="relu"))
81 81
     model.add(Dropout(0.2))
82
+    model.add(Dense(256, activation="relu"))
83
+    model.add(Dense(256, activation="relu"))
82 84
     model.add(Dense(128, activation="relu"))
83 85
 
84 86
     # check to see if the regression node should be added
@@ -149,9 +151,8 @@ x = Dense(1024, activation="relu", kernel_regularizer=regularizers.l1(0.003))(co
149 151
 x = Dropout(0.2)(x)
150 152
 x = Dense(1024, activation="relu")(x)
151 153
 x = Dense(1024, activation="relu")(x)
152
-x = Dense(1024, activation="relu")(x)
153 154
 # 在建设一层
154
-x = Dense(3, activation="softmax")(x)
155
+x = Dense(4, activation="softmax")(x)
155 156
 
156 157
 # our final model will accept categorical/numerical data on the MLP
157 158
 # input and images on the CNN input, outputting a single value (the