Abstract. Stock price fluctuations are complex and play a crucial role in investment decision-making. Bank Rakyat Indonesia (BRI) shares, as one of the largest banking institutions in Indonesia, often reflect national economic conditions. Conventional approaches such as fundamental and technical analysis have limitations in capturing the non-linear patterns inherent in time-series stock price data. Therefore, this study aims to analyze the capability of the Random Forest algorithm in modeling Bank BRI stock prices based on historical data and to evaluate the accuracy of the resulting prediction model. This research utilizes one year of historical Bank BRI stock price data, consisting of 301 observations, with variables including Open, High, Low, Close, Adjusted Close, and Volume. The model was developed using the Random Forest algorithm with 200 estimators and no maximum tree depth, implemented using the PHP programming language. The dataset was divided into 80% training data and 20% testing data. The experimental results indicate that the Random Forest algorithm is capable of effectively modeling Bank BRI stock price patterns and adequately following actual price trends. Model evaluation produced a Mean Absolute Error (MAE) of Rp 155.0986 and a Root Mean Square Error (RMSE) of Rp 193.1669, with an average prediction error of Rp 155.1005. Most predictions from the 60 testing data points exhibited an error rate below 2%, indicating satisfactory predictive accuracy. These findings demonstrate that the Random Forest algorithm can effectively represent fluctuations in Bank BRI stock prices based on historical data and serve as a foundation for future stock price forecasting reasearch.
Copyrights © 2026