A Comparative Analysis Study of Stock Prediction Based on Random Forest and Decision Tree
As financial markets become increasingly complex and volatile, so does the need for accurate and efficient stock forecasting models. This study expects to investigate the effectiveness and accuracy of machine learning methods in stock price forecasting. In the article, the performance of random forest algorithm and decision tree algorithm in reducing stock investment risk is systematically evaluated and compared by using the MSE, MAE and R2 score as evaluation indicators through cross-validation technology. On this basis, this paper also deeply discusses the performance differences of the two algorithms in the field of stock forecasting through hyperparameter tuning and feature importance analysis. The study found that random forest was better than decision tree in prediction accuracy. The MSE and MAE of random forest are lower, 2.605 and 1.152 respectively, and R<sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2</sup> is closer to 1 (0.983). In contrast, the performance of decision tree model is slightly inferior, with higher MSE and MAE, 5.124 and 1.644, also a lower R2 (0.966). This conclusion that random forests are superior highlights the ability of random forests to process complex data. Although this paper has some limitations on the size of the dataset and the optimization of the model, the random forest algorithm still shows greater advantages in the comparative analysis with the decision tree algorithm in stock prediction. This study provides a reference for stock investors to choose a more accurate stock price prediction model in the future. This can effectively reduce investment risks and increase returns.
Authors
- Yixiao Gu
Institutions
- University of Glasgow (GB)
Publication Details
- Published
- 2024-09-23
- DOI
- https://doi.org/10.1109/icedcs64328.2024.00022
- Citations
- 9
- Primary Topic
- Stock Market Forecasting Methods
- Type
- article
- Field-Weighted Citation Impact
- 4.41