Implementation of Machine Learning for Stock Price Prediction Using the LSTM Algorithm

Authors

  • Nindy Raisa Hanum Nindy Universitas Jambi Author
  • Hasanatul Iftitah Author
  • Akhiyar Waladi Author
  • Yogi Perdana Author

DOI:

https://doi.org/10.62205/hfvfmj88

Keywords:

Long Short-Term Memory, Stock Price Prediction , Bank Central Asia, Time Series Analysis, Machine Learning

Abstract

This research focuses on predicting BCA stock prices using a Long Short-Term Memory (LSTM) model. Historical daily closing prices of BCA from February 2023 to October 2024 were sourced from Yahoo Finance and analyzed using Python. The data were preprocessed with MinMaxScaler and split into training (80%) and testing (20%) sets. Optimal model parameters were determined through Grid Search, resulting in an LSTM model with 150 units, 100 epochs, a batch size of 64, and a learning rate of 0.001. The model achieved an MSE of 23,365.97, an RMSE of 152.86, an MAE of 112.96, and an R² of 0.6170. Prediction visualizations revealed that the LSTM model successfully captured stock price trends. These results highlight the effectiveness of LSTM in analyzing complex time series patterns, offering reasonably accurate forecasts for supporting investment decisions.

Downloads

Published

2024-11-23

Issue

Section

Articles