Stock price prediction is an important component in making investment decisions. This study aims to compare the performance of four deep learning models, namely LSTM, Bi-LSTM, GRU, and Bi-GRU, in predicting stock prices, in order to find the most optimal model for the implementation of an accurate stock price prediction system. Five years of historical data undergoes normalization, windowing, and is separated into training data, validation data, and test data. Model training is conducted with different settings of batch size, timestep, and three kinds of optimizers (Adam, SGD, RMSprop). Performance assessment employs MSE, RMSE, MAE, and R² measurements. The findings indicate that the Bi-GRU model utilizing Adam optimizer settings, a batch size of 8, and a timestep of 21 yields the highest performance, achieving an MSE of 0.0003, an RMSE of 0.0169, an MAE of 0.0129, and an R² of 0.9438. This model demonstrates a strong capability to identify intricate patterns and long-term temporal relationships, outperforming other models in accuracy. The results advocate for the establishment of a predictive system that aids investors and firms in making strategic decisions based on data.
Copyrights © 2025