Research Article

Stock Prediction Based on Optimized LSTM and GRU Models

Table 2

Learning results of LASSO-LSTM.

Number of layersNumber of neuronsLook-back valueTrain MSETrain RMSETrain MAETest MSETest RMSETest MAETrain time

38101904.541043.641029.6357979.39331.295323.7622132.8780
38201272.188435.667824.2016904.954330.082522.6913307.9990
38302142.919246.291736.9945957.245430.939422.6934430.9928
38404629.9638868.043861.95415342.139673.089967.8341576.7966
38501214.774534.853623.3589881.026529.682121.0112766.2157
28101248.650835.336323.4574777.520827.884119.655495.1825
28201608.067640.100727.8215991.324431.485321.8147213.3500
28301251.198935.372322.9057858.066929.292819.7988320.6939
28401202.156134.672123.1705883.710129.727321.3382411.6595
28501206.704234.737623.1075850.248329.159020.6415490.2418
316101031.035832.109721.8451778.945927.909619.9938376.8092
316206555.537680.966375.54809468.341897.305493.4085779.2415
316301254.391535.417423.0273733.877327.090218.65171189.4983
316401015.528531.867421.3504872.576429.539420.94251603.3826
31650984.689131.379822.6411892.326329.871820.58842065.8919
216101051.316932.424021.6973786.579628.046019.8271212.8883
216201100.543033.174421.7411734.012227.092718.7960442.2047
216301854.974543.069434.89381331.527636.490130.3015725.7830
21640984.731631.380420.8187803.866728.352520.93271080.9957
216501006.728931.729021.1893846.484929.094421.38911346.3720
33210787.552228.063420.2811852.459029.196920.1759306.4265
33220816.338328.571620.29251199.147534.628723.9940636.0178
33230908.517030.141620.89151850.994843.023230.6120970.8293
33240844.316529.057120.14082720.098152.154632.72571291.5366
332501057.641632.521421.60942061.006145.398329.48761356.4536
232101117.402533.427622.2174799.080128.268019.8247454.6504
23220919.862630.329221.2240751.914627.421119.1840929.6708
232301096.116233.107623.05842220.707847.124431.13581358.4529
232401124.639533.535623.59111125.732233.551925.27331385.7139
232501442.568837.981229.58021449.245938.069029.88981497.0255

The number of epochs is 1000, learning rate is 0.001, and the activation function is .