Research Article

Stock Prediction using LSTM model

Junyan Xiao*
Huaer zizhu academy

* Corresponding author: [email protected]

Abstract

With the development of the times, investors are increasingly in demand for stock price forecasting. However, stock price fluctuations are full of uncertainty, making traditional machine learning algorithms more erroneous in long-term forecasting. Based on the LSTM model, this paper uses Tushare to obtain the historical price of stocks, and the optimal structure and best training parameters of the LSTM model in stock price prediction are determined experimentally. The prediction accuracy of the LSTM model was evaluated by MAE, and the best result was 69.15, which achieved accurate prediction of stock prices. Compared with the traditional SVR model and the ARMA model, the prediction results of LSTM are more in line with the actual value, and the prediction accuracy of the algorithm is higher.

Keywords: stock prediction; data mining; LSTM
Published: August 1, 2023
DOI: 10.54254/2755-2721/8/20230084
Volume: ACE Vol.8
pp. 74-79
Download PDF

References

  1. Pahwa, N., Khalfay, N., Soni, V., & Vora, D. (2017). Stock prediction using machine learning a review paper. International Journal of Computer Applications, 163(5), 36-43.
  2. TIAN Xiang,DENG Feiqi. Application of Accurate Online Support Vector Regression in Stock Index Forecasting[J]. Computer Engineering,2005,31(22):18-20
  3. FENG Pan,CAO Xianbing. An Empirical Study on Stock Price Analysis and Prediction Based on ARMA Model[J]. Mathematics in Practice and Theory, 2011(22): 84-90
  4. Wang Shuai,Shang Wei. Forecasting directionof china security index 300 movement with least squares support vector machine[J].Procedia Computer Science, 2014, 31:869 -874.
  5. Liu, E. . (2021). Comparison of stock price prediction ability based on GARCH and BP_ANN. 2021 2nd International Conference on Computing and Data Science (CDS).
  6. Deng, X. , Liang, W. , & Huang, N. . (2019). Stock prediction research based on dae-bp neural network. Computer Engineering and Applications.
  7. Hochreiter, S.; Schmidhuber, J. Long short-term memory[J]. Neural Comput.1997, 9, 1735–1780.
  8. Kingma, D. P., & Ba, J. (2015, January). Adam: A Method for Stochastic Optimization. In ICLR (Poster).
  9. Huang, G., Liu, Z., Van Der Maaten, L., & Weinberger, K. Q. (2017). Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 4700-4708).
  10. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., & Wojna, Z. (2016). Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 2818-2826).