Tesla stock prediction with SVM, decision tree and random forest
DOI:
https://doi.org/10.54097/6xrr2902Keywords:
stock prediction, machine learning, support vector machines.Abstract
Stock price prediction is a critical task in financial markets, as it helps traders and investors make informed decisions. This paper compares 3 popular machine learning techniques, which are Support Vector Machines (SVM), Decision Trees, and Random Forests, in predicting stock movements. This paper will evaluate and compare the performance of these models for predicting Tesla's stock price movements by using historical stock data. The 20-day Simple Moving Average (SMA20) is used as a key technical indicator which is combined with the basic stock features such as Open, High, Low, and Volume. The results demonstrate that the SVM model achieved the highest accuracy and recall even when only using the SMA20. However, the SVM model provided a better balance between precision (51.5078%) and recall (93.6404%), achieving the highest F1 score which is 66.4591%. The three models have different focuses and advantages, which also lead to the difference between the test values. In this prediction, the SVM model performs the best, compared to the other two models. With the results of the test, the SVM model is perfect for recognizing price increases in a short time with a balance between precision and recall.
Downloads
References
[1] Li, Y., Pan, Y. 2021. A novel ensemble deep learning model for stock prediction based on stock prices and news. Complex and Intelligent Systems, 7, 217 - 230.
[2] Patel, J., Shah, S., Thakkar, P., Kotecha, K. 2015. Predicting stock and stock price index movement using machine learning techniques. Expert Systems with Applications, 42 (1), 259 - 268.
[3] Sai Reddy, V. 2018. Stock market prediction using machine learning. International Journal of Computer Science and Information Technologies, 9 (1), 10 - 14.
[4] Lin, G., Guo, Y., Hu, Y. 2012. An SVM-based approach for stock market trend prediction. Procedia Computer Science, 24, 267 - 274.
[5] Demirel, U., Cam, H., Unlu, R. 2021. Predicting stock prices using machine learning methods and deep learning algorithms: The sample of the Istanbul Stock Exchange. GU Journal of Science, 34 (1), 63 - 82.
[6] Somvanshi, M., Chavan, P. 2014. A review of machine learning techniques using DT and support vector machine. IEEE, 1 - 5.
[7] Mahesh, B. 2019. Machine learning algorithms - A review. International Journal of Science and Research (IJSR), 9 (1), 381 - 386.
[8] Patel, M., Varma, S. 2017. Predicting stock prices using LSTM. International Journal of Science and Research (IJSR), 6 (4), 1754 - 1756.
[9] Kara, Y., Boyacioglu, M. A., Baykan, Ö. K. 2011. Predicting direction of stock price index movement using artificial neural networks and support vector machines: The sample of the Istanbul Stock Exchange. Expert Systems with Applications, 38 (5), 5311 - 5319.
[10] Lu, W., Li, J., Li, Y., Sun, A., Wang, J. 2020. A CNN-LSTM-based model to forecast stock prices. Complexity, 2020, Article ID 6622927.
[11] Liu, Y., Wang, Y., Zhang, J. 2012. New machine learning algorithm: RF. In B. Liu, M. Ma, J. Chang (Eds.), Information Computing and Applications, Third International Conference, ICICA 2012 (pp. 246-252). Springer, Berlin, Heidelberg.
[12] Sharaf, M., Hemdan, E. E., El-Sayed, A., El-Bahnasawy, N. A. 2021. StockPred: A framework for stock price prediction. Multimedia Tools and Applications, 80 (12), 17923 - 17954.
[13] Khan, A. H., Shah, A., Ali, A., Shahid, R., Zahid, Z. U., Sharif, M. U., Jan, T., Zafar, M. H. 2023. A performance comparison of machine learning models for stock market prediction with novel investment strategy. PLoS ONE, 18 (9), e0286362.
[14] Htun, H. H., Biehl, M., Petkov, N. 2024. Forecasting relative returns for S&P 500 stocks using machine learning. Financial Innovation, 10, 118.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Highlights in Business, Economics and Management

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.







