Research Article

Stock Prediction Based on Optimized LSTM and GRU Models

Table 3

Learning results of PCA-LSTM.

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

38101690.917141.120828.139710971.7773104.746372.824294.6602
38202939.533254.217536.524242278.7188205.6179176.8455198.6585
38303896.070162.418550.71395464.553773.922654.9697286.6041
38402811.640153.024935.259137730.9688194.2446160.7494410.7228
38502484.060849.840438.534530902.8711175.7921154.2262541.6164
28101619.030840.237227.521519627.638140.0987116.243260.6061
28202298.589147.943634.540317482.4219132.2211102.2909128.5815
28302054.780345.329732.686724208.5762155.5911125.7793191.2626
28402300.363547.962134.428127250.1621165.0762143.2569252.3014
28501614.692640.183226.503127625.6934166.2098140.6607313.6309
316101022.417831.975323.600219104.1875138.2179105.8687278.2536
316201744.881341.771831.4407100281.7656316.6730261.6820543.4168
31630932.114830.530623.07095806.194376.198458.5185846.4980
316401688.805341.095131.048372460.7422269.1853225.78331090.1818
316501101.541433.189525.58794054.689563.676442.89041654.7813
21610755.393627.484419.61687201.130484.859550.935393.1576
21620642.614025.349818.25083843.063761.992448.0259207.6672
21630734.115127.094619.650613394.8955115.736389.6245311.5668
21640737.102227.149619.18605955.741277.173459.1523427.4087
21650941.917530.690721.12894154.140664.452650.9237666.0416
33210599.829524.491419.429835741.8242189.0551124.2747514.5233
33220594.435124.381018.659745484.7734213.2716169.47781064.2589
33230455.746021.348216.178317365.6328131.778794.39151647.6020
33240805.406728.379723.09457770.926888.152958.47162789.5281
33250672.488725.932419.277591975.9453303.2754242.90422610.5209
23210495.863622.268016.660315152.0000123.093590.1184347.5115
23220627.717025.054318.43746696.089481.829650.5065721.5676
23230454.680121.323215.71415454.822873.856851.72491089.6257
23240548.592723.422117.234117594.1758132.6430105.71551437.5246
23250407.017520.174714.66088100.046490.000366.11211808.6861

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