Optimizing Random Forest Models for Stock Market Prediction with Hyperparameter Analysis
The forecasting of financial markets is an essential practice in the assessment of risk in financial transactions and investments. Traditional statistical techniques often suffer from various issues while analyzing such financial data and the evolving structure of market data. Random Forest (RF) is one of the most powerful machine learning methods to address the issues due to its ability to handle high-dimensional features and reduce overfitting. This paper assesses the effects of the alpha parameter, a tuning parameter for controlling the number of decision trees in RF models, on prediction accuracy. We collected the stock price data from the Yahoo Finance website and further preprocessed the data using feature engineering and time series smoothing methods to better fit a model. Although RF is proved to perform well in basic cases, it suffers from a temporal dependency problem considering the time-series data where the relationship between the features is dependent on time. To overcome these disadvantages, RF is proposed to be combined with time series analyses (for instance, ARIMA, GARCH) to handle temporal components within financial data for a specific time period. We evaluate the performance of RF and show that it can handle and generalize the complex relationships between the high-dimensional data. Our experimental analysis underscores the importance of hyperparameter tuning and data preprocessing in enhancing the performance of the RF model and points to imperative areas for integrating the RF with other machine learning algorithms in enhancing financial forecasts.
Authors
- Yicong Li (ORCID: https://orcid.org/0009-0001-1803-1302)
Institutions
- New York University (US)
Publication Details
- Published
- 2025-03-28
- DOI
- https://doi.org/10.1145/3745238.3745250
- Primary Topic
- Stock Market Forecasting Methods
- Type
- article
- Field-Weighted Citation Impact
- 0.00