Stock Price Prediction Using Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) Methods
Abstract
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.
Copyright (c) 2025 Laqma Dica Fitrani, Riza Akhsani Setyo Prayoga, Masti Fatchiyah Maharani, Angga Lisdiyanto

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution-ShareAlike 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.



