Comparing Machine Learning Models for Stock Prediction: LSTM Comes Out on Top
DOI:
https://doi.org/10.71426/jmt.v3.i1.pp361-366Keywords:
Prediction of trends, Stock market trends, Artificial Neural Network (ANN), Long Short-Term Memory (LSTM), Random Forest (RF), Support Vector Machine (SVM)Abstract
This study illuminates the critical role of time series prediction in various fields, particularly in forecasting stock market trends. It offers a comparative analysis of four machine learning models: Artificial Neural Network (ANN), Long Short-Term Memory (LSTM), Random Forest (RF), and Support Vector Machine (SVM). These models are meticulously trained and validated, ensuring a robust performance assessment. The ANN model consistently performs well across different forecast horizons, adeptly capturing complex stock market patterns. The LSTM model, however, excels in predicting shorter horizons, effectively utilizing its ability to capture temporal dependencies and short-term trends. Evaluation metrics reveal that the LSTM model outperforms the others, particularly in minimizing prediction errors. It achieves an impressive accuracy rate of 98.6%, further emphasizing its proficiency in forecasting stock market trends. Overall, this study highlights the superior performance of the LSTM model in stock market forecasting, especially for shorter horizons. The ANN model also demonstrates consistent performance across various horizons. These insights offer valuable guidance for investors and financial analysts, enabling informed decision-making based on reliable predictions.
References
[1] Fama EF. Efficient capital markets: A review of theory and empirical work. Journal of Finance. 1970;25(2):383–417. Available from: https://doi.org/10.1086/260053
[2] Lo AW, Mamaysky H, Wang J. Foundations of technical analysis: Computational algorithms, statistical inference, and empirical implementation. Journal of Finance. 2000;55(4):1705–1765. Available from: https://doi.org/10.1111/0022-1082.00265
[3] Kim KJ. Financial time series forecasting using support vector machines. Neurocomputing. 2003;55(1–2):307–319. Available from: https://doi.org/10.1016/S0925-2312(03)00372-2
[4] Huang W, Nakamori Y, Wang SY. Forecasting stock market movement direction with support vector machine. Computers & Operations Research. 2005;32(10):2513–2522. Available from: https://doi.org/10.1016/j.cor.2004.03.016
[5] Breiman L. Random forests. Machine Learning. 2001;45(1):5–32. Available from: https://doi.org/10.1023/A:1010933404324
[6] Zhang GP. Time series forecasting using a hybrid ARIMA and neural network model. Neurocomputing. 2003;50:159–175. Available from: https://doi.org/10.1016/S0925-2312(01)00702-0
[7] Bollen J, Mao H, Zeng X. Twitter mood predicts the stock market. Journal of Computational Science. 2011;2(1):1–8. Available from: https://doi.org/10.1016/j.jocs.2010.12.007
[8] Fischer T, Krauss C. Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research. 2018;270(2):654–669. Available from: https://doi.org/10.1016/j.ejor.2017.11.054
[9] Nelson DMQ, Pereira ACM, de Oliveira RA. Stock market price movement prediction with LSTM neural networks. Expert Systems with Applications. 2017;97:164–172. Available from: https://doi.org/10.1016/j.eswa.2017.02.043
[10] Bao W, Yue J, Rao Y. A deep learning framework for financial time series using stacked autoencoders and long short-term memory. PLoS ONE. 2017;12(7):e0180944. Available from: https://doi.org/10.1371/journal.pone.0180944
[11] Sezer OB, Ozbayoglu AM. Algorithmic financial trading with deep convolutional neural networks: Time series to image conversion approach. Applied Soft Computing. 2018;70:525–538. Available from: https://doi.org/10.1016/j.asoc.2018.05.024
[12] Chen T, Guestrin C. XGBoost: A scalable tree boosting system. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining; 2016; pp. 785–794. Available from: https://doi.org/10.1145/2939672.2939785
[13] Markowitz H. Portfolio selection. Journal of Finance. 1952;7(1):77–91. Available from: https://doi.org/10.2307/2975974
[14] Shen J, Shafiq MO. Short-term stock market price trend prediction using a comprehensive deep learning system. Journal of Big Data. 2020;7:66. Available from: https://doi.org/10.1186/s40537-020-00333-6
[15] Dixon M, Klabjan D, Bang JH. Classification-based financial markets prediction using deep neural networks. Algorithmic Finance. 2017;6(3–4):67–77. Available from: https://doi.org/10.3233/AF-170220
[16] Zakhidov G. Economic indicators: Tools for analyzing market trends and predicting future performance. International Multidisciplinary Journal of Universal Scientific Prospectives. 2024;2(3):23–29. Available from: https://www.researchgate.net/publication/380519295
[17] Saripudi K. A study on artificial intelligence and cloud computing assistance for enhancement of startup businesses. Journal of Computing and Data Technology. 2025;1(1):68–76. Available from: https://doi.org/10.71426/jcdt.v1.i1.pp68-76
[18] Ma Y, Mao R, Lin Q, Wu P, Cambria E. Multi-source aggregated classification for stock price movement prediction. Information Fusion. 2023;91:515–528. Available from: https://doi.org/10.1016/j.inffus.2022.10.025
[19] Bathla G, Rani R, Aggarwal H. Stocks of year 2020: Prediction of high variations in stock prices using LSTM. Multimedia Tools and Applications. 2023;82(7):9727–9743. Available from: https://doi.org/10.1007/s11042-022-12390-5
[20] Behera JP, Pasayat AK, Behera H, Kumar P. Prediction-based mean-value-at-risk portfolio optimization using machine learning regression algorithms for multi-national stock markets. Engineering Applications of Artificial Intelligence. 2023;120:105843. Available from: https://doi.org/10.1016/j.engappai.2023.105843
[21] Toochaei MR, Moeini F. Evaluating the performance of ensemble classifiers in stock returns prediction using effective features. Expert Systems with Applications. 2023;213:119186. Available from: https://doi.org/10.1016/j.eswa.2022.119186
[22] Yang X, Loua MA, Wu M, Huang L, Gao Q. Multi-granularity stock prediction with sequential three-way decisions. Information Sciences. 2023;621:524–544. Available from: https://doi.org/10.1016/j.ins.2022.11.077
[23] Liu X, Guo J, Wang H, Zhang F. Prediction of stock market index based on ISSA-BP neural network. Expert Systems with Applications. 2022;204:117604. Available from: https://doi.org/10.1016/j.eswa.2022.117604
[24] SadeghMalakAbadi S. Multifunctional landscapes and AI validation as a strategy to enhance creative place-making in urban voids. Authorea Preprints. 2025.
[25] Hossain MA, Karim R, Thulasiram R, Bruce ND, Wang Y. Hybrid deep learning model for stock price prediction. In: IEEE Symposium Series on Computational Intelligence (SSCI); 2018 Nov 18; pp. 1837–1844. Available from: https://ieeexplore.ieee.org/document/8628641
[26] Chaudhari K, Thakkar A. Data fusion with factored quantization for stock trend prediction using neural networks. Information Processing & Management. 2023;60(3):103293. Available from: https://doi.org/10.1016/j.ipm.2023.103293
[27] Chaudhari K, Thakkar A. Neural network systems with an integrated coefficient of variation-based feature selection for stock price and trend prediction. Expert Systems with Applications. 2023;219:119527. Available from: https://doi.org/10.1016/j.eswa.2023.119527
[28] Parhamfar M, Güven AF, Pinnarelli A, Vizza P, Soleimani A. Artificial intelligence in carbon trading: Enhancing market efficiency and risk management. Journal of Computing and Data Technology. 2025;1(1):19–39. Available from: https://doi.org/10.71426/jcdt.v1.i1.pp19-39
[29] Taghizadeh A, Karaminezhad K, Fakhri N, Moghaddami B, Charkhian D. Assessing innovation strategies in the digital economy through artificial intelligence-based criteria using CoCoSo method. Journal of Intelligent Decision Making and Granular Computing. 2025;1(1):237–255. Available from: https://doi.org/10.31181/jidmgc11202523
[30] Zhang Q, Qin C, Zhang Y, Bao F, Zhang C, Liu P. Transformer-based attention network for stock movement prediction. Expert Systems with Applications. 2022;202:117239. Available from: https://doi.org/10.1016/j.eswa.2022.117239
[31] Kanwal A, Lau MF, Ng SPH, Sim KY, Chandrasekaran S. BiCuDNNLSTM-1dCNN — A hybrid deep learning-based predictive model for stock price prediction. Expert Systems with Applications. 2022;202:117123. Available from: https://doi.org/10.1016/j.eswa.2022.117123
[32] Irani H, Ghahremani Y, Kermani A, Metsis V. Time series embedding methods for classification tasks: A review. arXiv preprint. 2025;arXiv:2501.13392. Available from: http://arxiv.org/abs/2501.13392
[33] Irani H, Metsis V. Enhancing time-series prediction with temporal context modeling: A Bayesian and deep learning synergy. In: Proceedings of the International Florida Artificial Intelligence Research Society Conference (FLAIRS); 2024 May 12; Vol. 37. Available from: https://doi.org/10.32473/flairs.37.1.135583
[34] Mashhadi S, Saghezchi A, Kashani VG. Interpretable machine learning for predicting startup funding, patenting, and exits. arXiv preprint. 2025;arXiv:2510.09465. Available from: http://arxiv.org/abs/2510.09465
[35] Salman HA, Kalakech A, Steiti A. Random forest algorithm overview. Babylonian Journal of Machine Learning. 2024;2024:69–79. Available from: https://doi.org/10.58496/BJML/2024/007
[36] Entezami Z, Davis CH, Entezami M. An AI-assisted topic model of the media literacy research literature. Media Literacy and Academic Research. 2025;8(1):5–28. Available from: https://doi.org/10.34135/mlar-25-01-01
[37] Shaban WM, Ashraf E, Slama AE. SMP-DL: A novel stock market prediction approach based on deep learning for effective trend forecasting. Neural Computing and Applications. 2023;36(4):1849–1873. Available from: https://doi.org/10.1007/s00521-023-09179-4
[38] Ahmadkhan K, Ahmadirad Z, Karaminezhad K, SeyedKhamoushi F, Karimi K, Khakpash F. A novel blockchain-based approach for enhanced food supply chain traceability and waste mitigation. British Food Journal. 2025;128(1):426–466. Available from: https://doi.org/10.1108/bfj-05-2024-0430
[39] Pezeshgi A, Naeimi M, Family Q. Buying on impulse in the age of AI: Mechanisms, evidence, and moral dilemmas. SSRN Electronic Journal. 2025. Available from: https://doi.org/10.2139/ssrn.5402344
[40] Seifi N, Ghoodjani E, Majd SS, Maleki A, Khamoushi S. Evaluation and prioritization of artificial intelligence integrated blockchain factors in healthcare supply chain: A hybrid decision making approach. Computer and Decision Making. 2025;2:374–405. Available from: https://doi.org/10.59543/comdem.v2i.11029
[41] Basirat S, Raoufi S, Bazmandeh D, Khamoushi S, Entezami M. Ranking of AI-based criteria in health tourism using fuzzy SWARA method. Computer and Decision Making. 2025;2:530–545. Available from: https://doi.org/10.59543/comdem.v2i.13795
[42] Amiri MK, Zaferani SPG, Emami MRS, Zahmatkesh S, Pourhanasa R, Namaghi SS, et al. Multi-objective optimization of thermophysical properties GO powders-DW/EG NF by RSM, NSGA-II, ANN, MLP and ML. Energy. 2023;280:128176. Available from: https://doi.org/10.1016/j.energy.2023.128176
[43] Afandizadeh S, Sedighi F, Kalantari N, Mirzahossein H. Modeling of the effect of transportation system accessibility on residential real estate prices: The case of Washington metropolitan area, USA. Case Studies on Transport Policy. 2024;18:101277. Available from: https://doi.org/10.1016/j.cstp.2024.101277
[44] Moradi AM, Sadri F, Sassani M, Akhmadaliyeva N, Xudaynazarov E, Matchanova B, et al. Modeling two-level interval and multi-objectives approach for energy optimization in the smart electrical grid with uncertainty of power prices and demand side management strategies. Results in Engineering. 2025;28:108384. Available from: https://doi.org/10.1016/j.rineng.2025.108384
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Alireza Taghizadeh, Alireza Taghizadeh, Arash Behzadi, Nika Fakhri, Seyedeh Atena Naghipour (Author)

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
Journal of Modern Technology (JMT) Journal operates under the Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). This allows others distribute, remix, tweak, and build upon the work, even commercially, as long as they credit the authors for the original creation. All authors publishing in JMT Journal accept these as the terms of publication.