Stock Price Prediction Based on Simple Decision Tree Random Forest and XGBoost
DOI:
https://doi.org/10.54691/bcpbm.v38i.4311Keywords:
Stock price prediction; decision tree; random forest; XGBoost.Abstract
Stock price prediction is the process of using a variety of methods and techniques to forecast the future performance of the stock. It is helpful for investors and traders to make decisions before and during trading. In this study, three stock prediction models depending on the decision tree algorithm are developed (i.e., Decision Tree, Random Forest and XGBoost) To be specific, their performances are compared to select the best prediction approach. Both accuracy and mean squared error (MSE) are utilized as metrics to evaluate the performances of models. By comparing the results and the metrics calculated according to the predictions, the random forest model is the best model with the highest accuracy and the smallest MSE. However, the XGBoost was the least accurate since this algorithm is too sensitive to the scale of the input variables. These results offer suggestions for choosing stock price prediction models and shed light on improving the models.
Downloads
References
Mian S N, Muhammad M N, Usman J G. Relationship between economic growth and stock market development. African journal of business management, 2010, 4.16: 3473-3479.
Vijh M, Chandola D, Tikkiwal V A, et al. Stock closing price prediction using machine learning techniques. Procedia computer science, 2020, 167: 599-606.
Obthong M, Tantisantiwong N, Jeamwatthanachai W, et al. A survey on machine learning for stock price prediction: algorithms and techniques. 2020, 1: 63-71.
Myles A J, Feudale R N, Liu Y, et al. An introduction to decision tree modeling. Journal of Chemometrics: A Journal of the Chemometrics Society, 2004, 18(6): 275-285.
Kamble R A. Short and long term stock trend prediction using decision tree. 2017 International Conference on Intelligent Computing and Control Systems (ICICCS). IEEE, 2017.
Loke K S. Impact of financial ratios and technical analysis on stock price prediction using random forests. 2017 International Conference on Computer and Drone Applications (IConDA). IEEE, 2017.
Khaidem L, Saha S, Dey S R. Predicting the direction of stock market prices using random forest. arXiv preprint arXiv:1605.00003, 2016.
Chen T, He T, Benesty M, et al. Xgboost: extreme gradient boosting. R package version 0.4-2, 2015, 1(4): 1-4.
AWS. How XGBoost Works. Accessed 17 December, 2022. Retrieved from: https://docs.aws.amazon.com/sagemaker/latest/dg/xgboost-HowItWorks.html.
Basak S, Kar S, Saha S, et al. Predicting the direction of stock market prices using tree-based classifiers. The North American Journal of Economics and Finance, 2019, 47: 552-567.






