Using the Random Forest Method in Predicting Stock Price Movements

  • Muhammad Amsari Lubis Universitas Islam Negeri Sumatera Utara
  • Samsudin Samsudin Universitas Islam Negeri Sumatera Utara
Keywords: Random Forest, Stock Price Prediction, Open Price, R-squared, MAPE

Abstract

In the era of globalization, rapid technological advancements have significantly impacted the financial sector, particularly stock price movements. This study aims to contribute to financial analysis and investment by providing a predictive tool to help investors make more informed investment decisions. The Random Forest method, a machine learning al-gorithm known for effectively handling complex and heterogeneous data, is used to pre-dict stock price movements. The study utilizes historical stock data from companies listed on the Indonesia Stock Exchange (IDX) as a case study. The resulting predictive model demonstrates high accuracy, achieving 98% accuracy, with an R-squared (R²) value of 0.94 and a Mean Absolute Percentage Error (MAPE) of 0.40%. This research identifies key factors, such as Previous, High, Low, Volume, and Change, that significantly influ-ence stock price movements. The strengths of this study lie in its use of an extensive da-taset, involving 104 stock codes as examples, and its integration of interactive visualiza-tion via Streamlit to enhance data interpretation. This tool is expected to be a reliable solu-tion that provides superior predictive capabilities compared to traditional methods and supports more accurate investment analysis in the stock market.

Published
2025-02-07