Red Onion Price Prediction in Bandar Lampung Using Long Short-Term Memory
Abstract
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.
Downloads
References
J. Cahyani, S. Mujahidin, dan T. P. Fiqar, “Implementasi Metode Long Short Term Memory (LSTM) untuk Memprediksi Harga Bahan Pokok Nasional,” J. Sist. Dan Teknol. Inf. JustIN, vol. 11, no. 2, hlm. 346, Jul 2023, doi: 10.26418/justin.v11i2.57395.
A. R. H. Dwika dan D. Avianto, “Implementasi Algoritma LSTM untuk Prediksi Harga Cabai Merah Keriting di Yogyakarta,” J. Indones. Manaj. Inform. Dan Komun., vol. 5, no. 1, hlm. 635–648, Jan 2024, doi: 10.35870/jimik.v5i1.534.
M. David, I. Cholissodin, dan N. Yudistira, “Prediksi Harga Cabai menggunakan Metode Long-Short Term Memory (Case Study : Kota Malang)”.
F. I. Sanjaya dan D. Heksaputra, “Prediksi Rerata Harga Beras Tingkat Grosir Indonesia dengan Long Short Term Memory,” JATISI J. Tek. Inform. Dan Sist. Inf., vol. 7, no. 2, hlm. 163–174, Agu 2020, doi: 10.35957/jatisi.v7i2.388.
Y. N. Sukmaningtiyas, S. Zahara, M. F. Rohmah, dan S. Sugianto, “Pemodelan Prediksi Harga Beras Medium Wilayah Jawa Timur Menggunakan Stacked LSTM,” SUBMIT J. Ilm. Teknol. Infomasi Dan Sains, vol. 3, no. 2, hlm. 20–24, Des 2023, doi: 10.36815/submit.v3i2.3061.
L. S. Hasibuan dan Y. Novialdi, “Prediksi Harga Minyak Goreng Curah dan Kemasan Menggunakan Algoritme Long Short-Term Memory (LSTM),” J. Ilmu Komput. Dan Agri-Inform., vol. 9, no. 2, hlm. 149–157, Nov 2022, doi: 10.29244/jika.9.2.149-157.
M. Lim dan T. Handhayani, “PENERAPAN LSTM DAN GRU UNTUK PREDIKSI HARGA CABAI MERAH DI KOTA JAWA TIMUR,” J. Inform. Dan Tek. Elektro Terap., vol. 13, no. 2, Apr 2025, doi: 10.23960/jitet.v13i2.6467.
R. Firdaus, “Prediksi Indeks Harga Produsen Pertanian Karet Di Indonesia Menggunakan Metode LSTM,” J. FASILKOM, vol. 13, no. 01, hlm. 1–6, Mei 2023, doi: 10.37859/jf.v13i01.4851.
A. Tholib, N. K. Agusmawati, dan F. Khoiriyah, “PREDIKSI HARGA EMAS MENGGUNAKAN METODE LSTM DAN GRU,” J. Inform. Dan Tek. Elektro Terap., vol. 11, no. 3, Agu 2023, doi: 10.23960/jitet.v11i3.3250.
G. Budiprasetyo, M. Hani’ah, dan D. Z. Aflah, “Prediksi Harga Saham Syariah Menggunakan Algoritma Long Short-Term Memory (LSTM),” J. Nas. Teknol. Dan Sist. Inf., vol. 8, no. 3, hlm. 164–172, Jan 2023, doi: 10.25077/TEKNOSI.v8i3.2022.164-172.
S. J. Pipin, R. Purba, dan H. Kurniawan, “Prediksi Saham Menggunakan Recurrent Neural Network (RNN-LSTM) dengan Optimasi Adaptive Moment Estimation,” J. Comput. Syst. Inform. JoSYC, vol. 4, no. 4, hlm. 806–815, Agu 2023, doi: 10.47065/josyc.v4i4.4014.
A. Hanafiah, Y. Arta, H. O. Nasution, dan Y. D. Lestari, “Penerapan Metode Recurrent Neural Network dengan Pendekatan Long Short-Term Memory (LSTM) Untuk Prediksi Harga Saham,” Bull. Comput. Sci. Res., vol. 4, no. 1, hlm. 27–33, Des 2023, doi: 10.47065/bulletincsr.v4i1.321.
A. S. B. Karno, “Prediksi Data Time Series Saham Bank BRI Dengan Mesin Belajar LSTM (Long ShortTerm Memory),” J. Inform. Inf. Secur., vol. 1, no. 1, hlm. 1–8, Mei 2020, doi: 10.31599/jiforty.v1i1.133.
T. Lattifia, P. W. Buana, dan N. K. D. Rusjayanthi, “Model Prediksi Cuaca Menggunakan Metode LSTM,” JITTER J. Ilm. Teknol. Dan Komput., vol. 3, no. 1, hlm. 994, Mar 2022, doi: 10.24843/JTRTI.2022.v03.i01.p35.
E. Supriyadi, “PREDIKSI PARAMETER CUACA MENGGUNAKAN DEEP LEARNING LONG-SHORT TERM MEMORY (LSTM),” J. Meteorol. Dan Geofis., vol. 21, no. 2, hlm. 55, Jan 2021, doi: 10.31172/jmg.v21i2.619.
H. Utama, “PENDEKATAN DEEP LEARNING MENGGUNAKAN METODE LSTM UNTUK PREDIKSI HARGA BITCOIN,” Indones. J. Comput. Sci. Res., vol. 2, no. 2, hlm. 43–50, Agu 2023, doi: 10.59095/ijcsr.v2i2.77.
Ghufron Tamami dan M. Arifin, “Penggunaan LSTM dalam Membangun Prediksi Penjualan untuk Aplikasi Laptop Lens,” J. FASILKOM, vol. 14, no. 2, hlm. 301–308, Agu 2024, doi: 10.37859/jf.v14i2.7372.
P. A. Riyantoko, T. M. Fahruddin, K. Maulida, dan E. M. Safitri, “ANALISIS PREDIKSI HARGA SAHAM SEKTOR PERBANKAN MENGGUNAKAN ALGORITMA LONG-SHORT TERMS MEMORY (LSTM),” 2020.
D. M. Legawa, M. R. Rizqullah, dan A. P. Sari, “APPLICATION OF LSTM ALGORITHM FOR BYD STOCK PRICE PREDICTION,” 2025.
M. L. Ashari dan M. Sadikin, “PREDIKSI DATA TRANSAKSI PENJUALAN TIME SERIES MENGGUNAKAN REGRESI LSTM,” J. Nas. Pendidik. Tek. Inform. JANAPATI, vol. 9, no. 1, hlm. 1, Apr 2020, doi: 10.23887/janapati.v9i1.19140.
D. R. Alghifari, M. Edi, dan L. Firmansyah, “Implementasi Bidirectional LSTM untuk Analisis Sentimen Terhadap Layanan Grab Indonesia,” J. Manaj. Inform. JAMIKA, vol. 12, no. 2, hlm. 89–99, Sep 2022, doi: 10.34010/jamika.v12i2.7764.
M. A. Pertiwi dan D. Permana, “Prediksi Harga Saham PT. GoTo Gojek Tokopedia Tbk. Menggunakan Long Short-Term Memory”.
R. Sari, A. S. Saruman, dan F. E. Susilawati, “Prediksi Harga Dogecoin dengan Menggunakan Metode Long Short-term Memory (LSTM),” 2023.
D. D. N. Cahyo dan A. Sunyoto, “Analisis Perbandingan Klasifikasi dalam Data Mining pada Prediksi Hujan dengan menggunakan Algoritma LSTM dan GRU,” J. Sains Dan Inform., vol. 11, no. 1, hlm. 40–49, Jun 2025, doi: 10.34128/jsi.v11i1.1212.
I Gusti Ayu Nandia Lestari dan I Nyoman Dwi Arysna Mahendra, “Prediksi Kualitas Udara dengan Menggunakan Metode Long Short-Term Memory dan Artificial Neural Network,” J. Sist. Dan Inform. JSI, vol. 17, no. 2, hlm. 121–129, Mei 2023, doi: 10.30864/jsi.v17i2.565.
Kartika, A. D. P., Anindo Saka Fitri, & Nambi Sembilu. (2025). Developing a Web-Based Printing Transaction System Using The Prototype Method: A Case Study at Amanah Advertising. JURNAL TEKNOLOGI DAN OPEN SOURCE, 8(2), 514 - 528. https://doi.org/10.36378/jtos.v8i2.4692
Irawan, Y., Refni Wahyuni, & Herianto. (2025). An Integrated Machine Learning and Deep Learning Approach for Multiclass Flood Risk Classification with Feature Selection and Imbalanced Data Handling. JURNAL TEKNOLOGI DAN OPEN SOURCE, 8(2), 650 - 661. https://doi.org/10.36378/jtos.v8i2.4639
Revina Pravita Sari, Karnadi, & Jimmie. (2025). Applying the Waterfall method to build applications E-Commerce at Palembang City Computer Embroidery Partners. JURNAL TEKNOLOGI DAN OPEN SOURCE, 8(2), 1243 - 1256. https://doi.org/10.36378/jtos.v8i2.5199
Copyright (c) 2026 Naufal Arby Danuartha

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
This is an open-access article distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License which permits unrestricted use, distribution, and reproduction in any medium. Users are allowed to read, download, copy, distribute, search, or link to full-text articles in this journal without asking by giving appropriate credit, provide a link to the license, and indicate if changes were made. All of the remix, transform, or build upon the material must distribute the contributions under the same license as the original.












