Comparative Analysis of ML models for Stock Price Prediction

Authors

  • Yaolong Xiang

DOI:

https://doi.org/10.54097/k2vgnz37

Keywords:

Stock Price Prediction, Machine Learning, Regression Model.

Abstract

Due to the unstable and non-stationary nature of financial market volatility, accurately predicting stock prices remains a challenging task. This study employs historical prices and technical indicators as features, comparing five machine learning models: linear regression, k-nearest neighbors, support vector regression, eXtreme Gradient Boosting, and random forests. The performance of these models is assessed based on mean squared error, R² score, and prediction accuracy within 1% and 2% thresholds. Experiment results show that eXtreme Gradient Boosting performed overall with the best accuracy under significant event impact and with a short-term dataset (approximately 2 years). The experiment also takes window rolling to make every model perform more stably. This study discusses the performance of the five models mentioned and uses the designed models to run through the same condition of the dataset to compare their differences. The limitations of the current work are taken into consideration, and directions for future research are identified.

Downloads

Download data is not yet available.

References

[1] Bodie, Z., Kane, A., Marcus, A. J. Investments (12th ed.). McGraw-Hill Education, 2021.

[2] Graham, B., Dodd, D. L. Security analysis (6th ed.). McGraw-Hill, 2009.

[3] 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.

[4] Cao, Y., He, H., Wang, J. Feature-based forecast model performance prediction. Information Sciences, 2021, 576, 1–13.

[5] James, G., Witten, D., Hastie, T., Tibshirani, R. An introduction to statistical learning. Springer, 2013.

[6] Altman, N. S. An introduction to kernel and nearest-neighbor nonparametric regression. The American Statistician, 1992, 46 (3), 175–185.

[7] Breiman, L. Random forests. Machine Learning, 2001, 45 (1), 5–32.

[8] Drucker, H., Burges, C. J., Kaufman, L., Smola, A., Vapnik, V. Support vector regression machines. Advances in Neural Information Processing Systems, 1997, 9, 155–161.

[9] Chen, T., Guestrin, C. XGBoost: A scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016, 785–794.

[10] Hastie, T., Tibshirani, R., Friedman, J. H. The elements of statistical learning: Data mining, inference, and prediction (2nd ed.). Springer, 2009.

[11] Patel, S., Shah, D., Patel, S. Forecasting stock market trends using machine learning algorithms. Procedia Computer Science, 2015, 50, 106–111.

[12] Lopez de Prado, M. Advances in financial machine learning. John Wiley & Sons, 2018.

[13] Hyndman, R. J., Koehler, A. B. Another look at measures of forecast accuracy. International Journal of Forecasting, 2006, 22 (4), 679–688.

[14] Willmott, C. J., Matsuura, K. Advantages of the mean absolute error. Climate Research, 2005, 30 (1), 79–82.

[15] De Myttenaere, A., Golden, B., Le Grand, B., & Rossi, F. Mean absolute percentage error for regression models. Neurocomputing, 2016, 192, 38–48.

Downloads

Published

29-01-2026

Issue

Section

Articles

How to Cite

Xiang, Y. (2026). Comparative Analysis of ML models for Stock Price Prediction. Academic Journal of Science and Technology, 19(2), 384-394. https://doi.org/10.54097/k2vgnz37