Stock Price Prediction Based on LSTM in Python

Authors

  • Zhuojin Zhang

DOI:

https://doi.org/10.54691/bcpbm.v40i.4398

Keywords:

Stock price prediction; data analysis; LSTM.

Abstract

To reduce the risk of people buying and increase the rate of return, applying a suitable model to predict stock prices is necessary. The research applies Long Short Term Memory (LSTM), which is a kind of artificial neural network in machine learning and is also a special kind of RNN. Through studying this model, the memory of LSTM is like human memory, which is composed of short-term memory and long-term accumulation. In this paper, the current data of 2020 and 2021 is to train, and the data from 2017 to 2019 is for testing. The data comes from three companies, GOOGLE, APPLE and AMAZON in the S&P500 index. Meanwhile, Mean Squared Error (MSE) is used for evaluation. Finally, in comparison with the different training times, LSTM presents good applicability, achieving negligible MSE.

Downloads

Download data is not yet available.

References

Fu, K., Yin, X., & Wang, Q. (2020). Stock Trend Prediction of Multi-Feature Based on LSTM. Journal of Beijing University of Posts and Telecommunications( Social Sciences Edition), 22(5), 17–27.

Cao, A., & Wu, M. (n.d.). Daily Stock Price Prediction Based on Long and Short Term Memory Neural Network. China Computer & Communication, 2022(1), 59–61.

Li , L., Zeng, L., Jiang, S., & He, W. (2022). Stock Price Prediction Based on LSTM Neural Network. Journal of Yunnan University Nationalities(Natural Sciences Edition), 3.

Bai, Y., Cheng, H., & Ye, Z. (2022). Application of Underactuated Process Control Method Based on RNN Compensator. Control Engineering of China, 1–10.

Ding, F. (2022). Price Trend Prediction of an Engineering Product Based on RNN Model. Science and Technology Innovation, 07, 77–80.

Jiang, B., Yue, J., & Lan, S. (2021). Research on Stock Prediction System Based on LSTM Neural Network. JOURNAL OF HEBEI INSTITUTE OF ARCHITECTURE AND CIVIL ENGINEERING, 39(4), 166–170.

Lin, X., & Zhu, X. (2022). Attention-Mechanism-Based LSTM Model for Stock Price Predicting. J Chongqing Technol & Business Univ(Nat Sci Ed), 39(2), 76–82.

Peng, Y., Liu, Y., & Zhang, R. (2019). Modeling and Analysis of Stock Price Forecast Based on LSTM. Computer Engineering and Applications, 55(11), 209–212.

Zhang, X., Xu, X., & Wei,S.. (2020). Stock Prediction with LSTM Neural Networks. Computer Knowledge and Technology, 16(28), 39–43.

Huang, Y., & Fang, W. (2021). Research on Stock Price Prediction Based on LSTM Network. Modern Computer, 27(34), 51–60.

Zhang, K., Ye, C., Li, Z., & Wang, J. (2021). Analysis and Forecast of Stock Price Based on LSTM Model of Pytorch. COMPUTER TECHNOLOGY AND DEVELOPMENT, 31(1), 162–167.

Downloads

Published

2023-03-08

How to Cite

Zhang, Z. (2023). Stock Price Prediction Based on LSTM in Python. BCP Business & Management, 40, 335-342. https://doi.org/10.54691/bcpbm.v40i.4398