The Efficient Market Hypothesis postulates that stock prices are unpredictable and complex, so they are challenging to forecast. However, this study demonstrates that it is possible to predict stock prices with reasonable accuracy using machine learning (ML) and deep learning (DL) models with optimized parameters. This compares ML models, such as Random Forest (RF) and XGBoost, against deep learning models, such as Long Short-Term Memory (LSTM), in terms of the accuracy of their market forecasting over different time horizons. The above models are used to predict the Apple stock market prices captured from Yahoo Finance from 2015 to 2020. The primary purpose of this paper is to enhance the prediction accuracy by tuning hyperparameters to choose the best optimization parameters that fit every predictive model. The experimental part of this paper uses fixed value (default) parameters for each model compared to the use of tuned hyperparameters; it tries combinations of hyperparameters and evaluates their performance on a validation set. This is done to determine the extent to which the hyperparameters enhanced the accuracy of the predictions and their impact on the results. The LSTM model achieved higher accuracy and recorded the first rank. They lowered it from 5.22 to 3.82; XGBoost had the second-best reduction of RMSE from 0.79 to 0.65, and Random Forest had a low-rate reduction of RMSE from 28.12 to 27.39. This means that effect-tuning hyperparameters can be used to improve the model’s prediction accuracy and lower the error rate.
References
[1]
Julian, T., Devrison, T., Anora, V. and Suryaningrum, K.M. (2023) Stock Price Prediction Model Using Deep Learning Optimization Based on Technical Analysis Indicators. Procedia Computer Science, 227, 939-947. https://doi.org/10.1016/j.procs.2023.10.601
[2]
Yu, P. and Yan, X. (2019) Stock Price Prediction Based on Deep Neural Networks. Neural Computing and Applications, 32, 1609-1628. https://doi.org/10.1007/s00521-019-04212-x
[3]
Wang, Z., Ho, S. and Lin, Z. (2018). Stock Market Prediction Analysis by Incorporating Social and News Opinion and Sentiment. 2018 IEEE International Conference on Data Mining Workshops (ICDMW), Singapore, 17-20 November 2018, 1375-1380. https://doi.org/10.1109/icdmw.2018.00195
[4]
Duong, H. and Nguyen-Thi, T. (2021) A Review: Preprocessing Techniques and Data Augmentation for Sentiment Analysis. Computational Social Networks, 8, Article No. 1. https://doi.org/10.1186/s40649-020-00080-x
[5]
Hamed, S., Ezzat, M. and Hefny, H. (2020) A Review of Sentiment Analysis Techniques. International Journal of Computer Applications, 176, 20-24. https://doi.org/10.5120/ijca2020920480
[6]
Sonkavde, G., et al. (2023) Forecasting Stock Market Prices Using Machine Learning and Deep Learning Models: A Systematic Review, Performance Analysis and Discussion of Implications. International Journal of Financial Studies, 11, Article 94. https://doi.org/10.3390/ijfs11030094
[7]
Ateeq, K., Abdelrahim, A., Zarooni, A., Rehman, A. and Khan, A. (2023) A Mechanism for Bitcoin Price Forecasting Using Deep Learning. International Journal of Advanced Computer Science and Applications, 14, 441-448. https://www.ijacsa.thesai.org
[8]
Chen, J. (2023) Analysis of Bitcoin Price Prediction Using Machine Learning. Journal of Risk and Financial Management, 16, Article 51. https://doi.org/10.3390/jrfm16010051
[9]
Li, J., Bu, H. and Wu, J. (2017) Sentiment-Aware Stock Market Prediction: A Deep Learning Method. 2017 International Conference on Service Systems and Service Management, Dalian, 16-18 June 2017, 1-6.
[10]
Vijh, M., Chandola, D., Tikkiwal, V.A. and Kumar, A. (2020) Stock Closing Price Prediction Using Machine Learning Techniques. Procedia Computer Science, 167, 599-606. https://doi.org/10.1016/j.procs.2020.03.326
[11]
Mukherjee, S., Sadhukhan, B., Sarkar, N., Roy, D. and De, S. (2021) Stock Market Prediction Using Deep Learning Algorithms. CAAI Transactions on Intelligence Technology, 8, 82-94. https://doi.org/10.1049/cit2.12059
[12]
Chatterjee, A., Bhowmick, H. and Sen, J. (2021) Stock Price Prediction Using Time Series, Econometric, Machine Learning, and Deep Learning Models. 2021 IEEE Mysore Sub Section International Conference (MysuruCon), Hassan, 24-25 October 2021, 289-296. https://doi.org/10.1109/mysurucon52639.2021.9641610
[13]
Chen, S. (2022) Stock Price Prediction Using LSTM Model. CAIBDA 2022—2nd International Conference on Artificial Intelligence, Big Data and Algorithms, Nanjing, 17-19 June 2022, 217-220.
[14]
Zhang, R. (2022) LSTM-Based Stock Prediction Modeling and Analysis. Advances in Economics, Business and Management Research, 211, 2537-2542. https://doi.org/10.2991/aebmr.k.220307.414
[15]
Shao, G. (2023) Prediction of Stock Prices Based on the LSTM Model. Atlantis Press International BV. https://doi.org/10.2991/978-94-6463-142-5_42
[16]
Zhang, Y. (2022) Stock Price Prediction Method Based on Xgboost Algorithm. Atlantis Press International BV. https://doi.org/10.2991/978-94-6463-030-5_60
[17]
Qian, H. (2022) Stock Predicting Based on LSTM and Arima. Proceedings of the 2022 2nd International Conference on Economic Development and Business Culture (ICEDBC 2022), Dali, 24-26 June 2022, 485-490. https://doi.org/10.2991/978-94-6463-036-7_72
[18]
Khaidem, L., Saha, S. and Dey, S.R. (2016) Predicting the Direction of Stock Market Prices Using Random Forest. arXiv: 1605.00003.
[19]
Nirob, F.A. and Hasan, M.M. (2023) Predicting Stock Price from Historical Data Using LSTM Technique. Journal of Artificial Intelligence and Data Science (JAIDA), 3, 36-49.
[20]
Wu, S., Liu, Y., Zou, Z. and Weng, T. (2021) S_I_LSTM: Stock Price Prediction Based on Multiple Data Sources and Sentiment Analysis. Connection Science, 34, 44-62. https://doi.org/10.1080/09540091.2021.1940101
[21]
Subasi, A., Amir, F., Bagedo, K., Shams, A. and Sarirete, A. (2021) Stock Market Prediction Using Machine Learning. Procedia Computer Science, 194, 173-179. https://doi.org/10.1016/j.procs.2021.10.071
[22]
Moghar, A. and Hamiche, M. (2020) Stock Market Prediction Using LSTM Recurrent Neural Network. Procedia Computer Science, 170, 1168-1173. https://doi.org/10.1016/j.procs.2020.03.049
[23]
Shahani, N.M., Zheng, X., Liu, C., Hassan, F.U. and Li, P. (2021) Developing an Xgboost Regression Model for Predicting Young’s Modulus of Intact Sedimentary Rocks for the Stability of Surface and Subsurface Structures. Frontiers in Earth Science, 9, Article 761990. https://doi.org/10.3389/feart.2021.761990
[24]
Chen, T. (2019) Release 0.81 XGBoost Developers.
[25]
Bentéjac, C., Csörgő, A. and Martínez-Muñoz, G. (2019) A Comparative Analysis of XGBoost. arXiv: 1911.01914.
[26]
Wu, Y. (2023) Stock Price Prediction Based on Simple Decision Tree Random Forest and XGBoost.
[27]
Yang, Y., Wu, Y., Wang, P. and Jiali, X. (2021) Stock Price Prediction Based on XGBoost and LightGBM. E3S Web of Conferences, 275, Article ID: 01040. https://doi.org/10.1051/e3sconf/202127501040
[28]
Kirasich, K., Smith, T. and Sadler, B. (2018) Random Forest vs Logistic Regression: Binary Classification for Heterogeneous Datasets. SMU Data Science Review, 1, Article 9.
[29]
Illa, P.K., Parvathala, B. and Sharma, A.K. (2022) Stock Price Prediction Methodology Using Random Forest Algorithm and Support Vector Machine. Materials Today: Proceedings, 56, 1776-1782. https://doi.org/10.1016/j.matpr.2021.10.460
[30]
Kurdi, F.T. (2021) Random Forest Machine Learning Technique for Automatic Vegetation Detection and Modelling in Lidar Data. International Journal of Environmental Sciences & Natural Resources, 28, Article ID: 556234. https://doi.org/10.19080/ijesnr.2021.28.556234
[31]
Alam, O. and Qiao, X. (2020) An In-Depth Review on Municipal Solid Waste Management, Treatment and Disposal in Bangladesh. Sustainable Cities and Society, 52, Article ID: 101775. https://doi.org/10.1016/j.scs.2019.101775