Stock Price Prediction Using Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) Methods - Riza Akhsani Setyo Prayoga; Fery Almas Ariansyah; Muhammad Falikhuddin Daffa; Laqma Dica Fitrani; Masti Fatchiyah Maharani; Angga Lisdiyanto; Steven Angkawidjaja (International Journal of Computer, Network Security and Information System, 2025)
This research aims to improve the accuracy of stock price prediction through the application of Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) methods, focusing on stocks from the Composite Stock Price Index (CSPI) referred to as the IDX Composite. The research process includes comprehensive steps, including data collection and preprocessing, dataset creation with emphasis on stock closing prices, and division of the dataset into training and test data. The LSTM and GRU models were designed with a recurrent layer and a Dense layer and then trained for 100 epochs with a batch size of 32. Model evaluation was performed by comparing key metrics such as Root Mean Squared Error (RMSE), Mean Squared Error (MSE), and Mean Absolute Error (MAE) on the test set. The EPOCH-RMSE graph provides an overview of the changes in the RMSE value during training. The best result of the LSTM model was achieved at the 96th epoch with RMSE 40.36, MSE 1385.97, and MAE 30.09, while GRU achieved peak performance at the 92nd epoch with RMSE 37.33, MSE 908.29, and MAE 25.42. In conclusion, GRU can be considered as a more effective option in predicting JCI stock prices based on performance evaluation using various metrics such as RMSE, MSE, and MAE.