Research Article

Empirical study on the performance of various machine learning models in predicting stock price movements as a binary classification task

Keqian Liu1, Ang Li2, Xinran Lin3,*, Zhuobin Mao4, Weiyang Zhang5
1. Sun Yat-Sen University
2. ShanghaiJiaotong University
3. University of Nottingham
4. Jinan University
5. University of Illinois Urbana Champaign

* Corresponding author: [email protected]

Abstract

This paper examines the accuracy of stock price rise-or-fall predictions of seven different machine learning algorithms, including support vector machines and random forests, for three industry types: securities, banks, and Internet companies. The purpose of the research is to explore the effects of different models in the stock market, so as to help people choose the optimal machine learning model in predicting different types of stocks. The study produced nine features based on the study by Patel et al for prediction. By collecting 9 types of stock data from companies in different industries, we performed necessary preprocessing on the data, fitted the model, tuned the parameters of the model and get the prediction result. Through the result, we found that the random forest algorithm has obvious advantages in binary classification prediction of stock prices. Linear discriminant analysis (LDA), Quadratic Discriminant Analysis (QDA) and logistic regression also have good fitting effects in this type of problem. K-Nearest Neighbor (KNN) and Naive Bayes algorithms exhibit poor prediction accuracy.

Keywords: Machine learning; stock; binary classification; Performance comparison; Feature selection
Published: July 25, 2024
DOI: 10.54254/2755-2721/55/20241403
Volume: ACE Vol.55
pp. 129-144
Download PDF

References

  1. Shaikh, Z. A., Kraikin, A., Mikhaylov, A., & Pinter, G. (2022). Forecasting Stock Prices of Companies Producing Solar Panels Using Machine Learning Methods. Complexity (New York, N.Y.), 2022, 1–9. https://doi.org/10.1155/2022/9186265
  2. Khoa, B. T., & Huynh, T. T. (2022). Forecasting stock price movement direction by machine learning algorithm. International Journal of Electrical and Computer Engineering (Malacca, Malacca), 12(6), 6625. https://doi.org/10.11591/ijece.v12i6.pp6625-6634
  3. Chhajer, P., Shah, M., & Kshirsagar, A. (2022). The applications of artificial neural networks, support vector machines, and long–short term memory for stock market prediction. Decision Analytics Journal, 2, 100015. https://doi.org/10.1016/j.dajour.2021.100015
  4. Ilyas, Q. M., Iqbal, K., Ijaz, S., Mehmood, A., & Bhatia, S. (2022). A Hybrid Model to Predict Stock Closing Price Using Novel Features and a Fully Modified Hodrick–Prescott Filter. Electronics (Basel), 11(21), 3588. https://doi.org/10.3390/electronics11213588
  5. Mahmoodi, A., Hashemi, L., Jasemi, M., Mehraban, S., Laliberté, J., & Millar, R. C. (2023). A developed stock price forecasting model using support vector machine combined with metaheuristic algorithms. Opsearch, 60(1), 59–86. https://doi.org/10.1007/s12597-022-00608-x
  6. Koukaras, P., Nousi, C., & Tjortjis, C. (2022). Stock Market Prediction Using Microblogging Sentiment Analysis and Machine Learning. Telecom (Basel), 3(2), 358–378. https://doi.org/10.3390/telecom3020019
  7. Patel, J., Shah, S., Thakkar, P., & Kotecha, K. (2015). Predicting stock and stock price index movement using Trend Deterministic Data Preparation and machine learning techniques. Expert Systems with Applications, 42(1), 259–268. https://doi.org/10.1016/j.eswa.2014.07.040