| A reasonable prediction of the trend and magnitude of stock price fluctuations can not only guide investors to make rational investments,but also help regulators to formulate more effective policies to guide the smooth operation of the stock market.While stock data is characterised by high noise,non-stationarity and high volatility,the complexity and uncertainty of its data have gradually reduced the status of classical statistical models in stock price prediction.With the development of deep learning,research has found that recurrent neural networks can better capture stock data information,making them stand out in the field of stock price prediction.However,recurrent neural networks suffer from subjectivity in determining key parameters and tend to fall into local optimality leading to poor capability.There is also the problem of redundancy between stock data leading to reduced model efficiency.Based on the above problems,this paper proposes two methods for optimizing neural networks.1.Propose a stock price prediction model based on RFE-GSWOA-LSTM.Firstly,the Shanghai Composite Index is selected as the experimental data,and the recursive feature elimination algorithm(RFE)is used to select the features of the data,and a perfect index system is established for prediction.Secondly,the improved whale algorithm(GSWOA)is used to optimize the important parameters of the long short-term memory neural network(LSTM),so as to reduce the influence of human factors and improve the accuracy of model prediction.Finally,the optimized parameters are brought into the LSTM network to construct the GSWOA-LSTM model,and the prediction results of the model are compared with other models.The experimental results show that the model proposed in this paper is significantly better than other models in predicting the Shanghai Composite Index.2.Propose a stock price prediction model based on LASSO-SSA-GRU.Firstly,the Shenzhen Stock Exchange Index is selected as the experimental data,and the variables are screened using the LASSO algorithm.Secondly,the sparrow algorithm(SSA)is used to optimize the key parameters of the gated recurrent unit neural network(GRU).Finally,the optimized parameters are brought into the GRU network to construct the SSA-GRU model,and the prediction results are compared with other models.The results show that the LASSO-SSA-GRU model proposed in this paper can effectively predict the stock price of the Shenzhen Component Index.It is confirmed by two methods that the optimized neural network makes the stock data characteristics and the neural network topology match each other,which improves the overall forecasting ability,which further shows that the algorithm design idea adopted in this paper has a certain reference value for stock price forecasting. |