Stock price prediction is a complex time-series problem because price movements are dynamic and exhibit temporal patterns. This study aims to implement and evaluate a Long Short-Term Memory (LSTM) model for forecasting the closing price of Apple Inc. (AAPL) stock using historical data obtained from Yahoo Finance for the 2022–2024 period. The data were preprocessed using Min-Max Scaling, transformed into sequences with a 60-day time step, and chronologically divided into 80% training data and 20% testing data. The model employed two LSTM layers with a dropout rate of 0.2, the Adam optimizer, and Mean Squared Error as the loss function. The evaluation results yielded a Root Mean Squared Error (RMSE) of 3.31 and a Mean Absolute Error (MAE) of 2.68. The visualization indicates that the predicted values generally follow the actual price trend, although deviations occur during several periods of sharper price changes. These findings indicate that the LSTM model can learn temporal patterns in AAPL closing prices and generate forecasts that approximate the actual values.
Copyrights © 2026