Stock price forecasting using machine-learning methods
Abstract
The stock market is essential in the economic growth of the nations in which it operates, and stock price prediction is of great significance to investors and government departments, as stocks provide both high reward and high risk. Nowadays, stock price prediction makes extensive use of machine learning algorithms. A large number of machine-learning models are available for predicting stock prices in the existing literature. In this article, the K-Nearest Neighbor (KNN), Random Forest (RF), Long Short-Term Memory (LSTM), and Gate Recurrent Unit (GRU) methods are applied to construct models to make stock forecasting based on Airbnb's historical stock data. The stock data are collected from 10th December 2020 to 19th August 2022. In addition, the accuracy of these four different models is analyzed and compared through Mean Square Error (MSE), Mean Absolute Error (MAE), and Resolvable coefficient (R^2) score metrics. The result shows that the LSTM and GRU models perform better than KNN and RF, with GRU showing the best results.
References
- Cheng, W. R. Investment Value Analysis Report of Pharmaceutical Companies - Based on Fundamental Perspective. Quality and Market, 2021 (22): 103-105.
- Ma, B. Z., Zhen, B. Q. Empirical analysis of gold futures price forecasting model based on time series analysis. Business, 2015, (07): 152.
- Zhao, A., Gao, J., & Guan, H. A Two-Factor Fuzzy-Fluctuation Time Series Forecasting Model for Stock Markets Based on a Probabilistic Linguistic Preference Relationship and Similarity Measure. IEEE Access, 2021, 9: 144740-144755
- Noella, N., Yeruva, V. R. R. Financial applications of machine learning: A literature review. Expert Systems with Applications, 2023, 219: 119640.
- Kyoung-jae Kim. Financial time series forecasting using support-vector machines. Neurocomputing, 2003, 55(1): 307-319.
- Yi, J. Research on stock market analysis and prediction based on EEMD and XGBoost algorithm. Shandong University, thesis for master’s degree, 2020.
- Hyun, S. S., Hae, I. K., Jae, J. A., Is Deep Learning for Image Recognition Applicable to Stock Market Prediction?. Complexity, 2019: 4324878.
- Yao, Y., Zhang, C. Y. A stock index price prediction method based on HP-LSTM model. Computer Engineering and Application, 2021, 57(24): 296-304.
- Yuan, W. K., Zhou, Z. T. Research on the influencing factors of stock price volatility based on PCA-BP neural network[J]. Commercial Exhibition Economics, 2023(10): 99-101.
- Zhang, S. C., et al. Learning k for knn classification. ACM Transactions on Intelligent Systems and Technology (TIST), 2017, 8(3): 1-19.
- Chung, J., Gülçehre, Ç., Cho, K., et al. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. CoRR, 2014: 1412.3555.