Red Onion Price Prediction in Bandar Lampung Using Long Short-Term Memory - Naufal Arby Danuartha (Universitas Islam Kuantan Singingi, 2026)
Shallots are a food commodity with fluctuating prices and influence people's needs. Unpredictable price changes can make it difficult for consumers, traders, and related parties to make decisions. This study aims to predict shallot prices in Bandar Lampung using the Long Short-Term Memory (LSTM) method. The data used are historical shallot price data from 2020 to 2025. The research stages include data preprocessing, normalization using Min-Max Scaler, dividing training data and test data with a 70:30 ratio, generating sequence data using a sliding window, parameter tuning experiments, LSTM model training, and model evaluation. Based on the experimental results, the best parameters were obtained at a lookback of 14, the number of neurons 50, the tanh activation function, a batch size of 48, a learning rate of 0.001, a maximum epoch of 150, and a patience of 15. The model produced a Mean Absolute Percentage Error (MAPE) value of 2.8035% with an accuracy of 97.1965% on the test data. These results indicate that the LSTM method is capable of predicting shallot prices in Bandar Lampung effectively and can follow price change patterns based on historical data. Furthermore, a comparison was conducted with the Gated Recurrent Unit (GRU) method using the same dataset and training parameters to evaluate the performance of the proposed model. The test results showed that the LSTM model performed better than the GRU.