
Comparison of XGBoost and LSTM Models for Stock Price Prediction
- 1 Warren College, University of California San Diego, San Diego, United States
* Author to whom correspondence should be addressed.
Abstract
Along with the development of technology, machine learning would take up a higher role in analyzing categories. Among those categories, predicting stock price meets the needs of most people–or most people who trade stocks. By referring to the predicting model, stock traders can decide whether they should trade in or trade out to make a profit in the stock market. Therefore, it is necessary to testify which model can make the prediction with higher accuracy. To analyze this problem, this article examines the performance of different models under different size of datasets. This paper compared XGBoost and LSTM model by collecting stock price data that are 3 years, 6 years, and 9 years ago from the year 2023. Then analyze the close price of stock prices those models. By comparing the figures and calculated rmse value in each year and each model, the impact of different dataset sizes on each model would be revealed. This paper discovered that XGBoost model has greater accuracy under large-size dataset overall, but LSTM can predict more accurate stock price under small-size dataset.
Keywords
XGBoost, LSTM, CVX Stock Price
[1]. Chung, J., Gulcehre, C., Cho, K., and Bengio, Y. (2014). Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555.
[2]. Kumar, D., Sarangi, P. K., and Verma, R. (2022). A systematic review of stock market prediction using machine learning and statistical techniques. Materials Today: Proceedings, 49, 3187-3191.
[3]. Friedman, J. H. (2001). Greedy function approximation: a gradient boosting machine. Annals of statistics, 1189-1232.
[4]. Chen, T., and Guestrin, C. (2016). Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining, 785-794.
[5]. Saud, A. S., and Shakya, S. (2020). Analysis of look back period for stock price prediction with RNN variants: A case study on banking sector of NEPSE. Procedia Computer Science, 167, 788-798.
[6]. Chudziak, A. (2023). Predictability of stock returns using neural networks: Elusive in the long term. Expert systems with applications, 213, 119203.
[7]. Hochreiter, S., and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8), 1735-1780.
[8]. Chen, Y., Wu, J., and Wu, Z. (2022). China’s commercial bank stock price prediction using a novel K-means-LSTM hybrid approach. Expert Systems with Applications, 202, 117370.
[9]. Bhandari, H. N., Rimal, B., Pokhrel, N. R., Rimal, R., Dahal, K. R., and Khatri, R. K. (2022). Predicting stock market index using LSTM. Machine Learning with Applications, 9, 100320.
[10]. Sak, H., Senior, A., & Beaufays, F. (2014). Long short-term memory based recurrent neural network architectures for large vocabulary speech recognition. arXiv preprint arXiv:1402.1128.
[11]. Luo, Y., Ye, W., Zhao, X., Pan, X., and Cao, Y. (2017). Classification of data from electronic nose using gradient tree boosting algorithm. Sensors, 17(10), 2376.
Cite this article
Li,Z. (2023). Comparison of XGBoost and LSTM Models for Stock Price Prediction. Advances in Economics, Management and Political Sciences,61,147-155.
Data availability
The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.
Disclaimer/Publisher's Note
The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
About volume
Volume title: Proceedings of the 2nd International Conference on Financial Technology and Business Analysis
© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and
conditions of the Creative Commons Attribution (CC BY) license. Authors who
publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons
Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this
series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published
version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial
publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and
during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See
Open access policy for details).