Data-Driven Model for Predicting Essential Commodity Demand: A Comparative Study of Weekend–Weekday Patterns in Chili Commodities Using Decision Tree and Random Forest Regression
DOI:
https://doi.org/10.30871/jaic.v10i2.12378Keywords:
Chili Price Forecasting, Decision Tree Regression, Random Forest Regression, Weekday-weekend Pattern, Machine LearningAbstract
Price fluctuations of chili commodities as essential food products directly affect public purchasing power and regional economic stability. Daily price movements are often influenced by temporal demand dynamics between weekdays and weekends; however, predictive approaches based on such patterns remain relatively limited in previous studies. This study aims to predict the prices of Red Bird’s Eye Chili and Curly Red Chili in Central Java Province using a data-driven approach by comparing the performance of Decision Tree Regression and Random Forest Regression based on weekday–weekend classification patterns. The dataset consists of daily price data from January 2023 to December 2025 obtained from the Provincial Industry and Trade Office of Central Java. The preprocessing stage includes missing value imputation, outlier detection using the Interquartile Range (IQR) method, Min–Max normalization, and categorical variable encoding. Pearson correlation analysis indicates a strong positive relationship between the two commodities with a coefficient of 0.64, suggesting interconnected price movements although not perfectly correlated. Model evaluation was conducted using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and the coefficient of determination (R²). The results show that Random Forest Regression produces relatively more stable predictive performance compared to Decision Tree Regression. For Red Bird’s Eye Chili, the model achieved an MAE of 0.2481, RMSE of 0.2741, and R² of 0.0038. For Curly Red Chili, the results obtained were an MAE of 0.1751, RMSE of 0.2204, and R² of −0.0135. Although the R² values indicate limited explanatory power in capturing price variability, the ensemble learning approach provides better prediction consistency in modeling volatile agricultural commodities. These findings contribute empirically to the development of machine learning-based price forecasting models at the provincial level by incorporating weekly temporal patterns.
Downloads
References
[1] E. Prawesti Ningrum, S. M, S. Endah Nursyamsi, and N. Siregar, “Faktor Terkait Kesenjangan Ekonomi dan Kesejahteraan,” PRIVE J. Ris. Akunt. dan Keuang., vol. 7, no. 2, pp. 116–126, 2024, doi: 10.36815/prive.v7i2.3480.
[2] P. Risk, K. Variasi, and R. Harga, “Risiko Harga Cabai Pada Tingkat Petani di Kabupaten Kediri Niken,” vol. 8, no. 1, pp. 181–192, 2026.
[3] M. David, I. Cholissodin, and N. Yudistira, “Prediksi Harga Cabai menggunakan Metode Long-Short Term Memory (Case Study : Kota Malang),” J. Pengemb. Teknol. Inf. dan Ilmu Komput., vol. 7, no. 3, pp. 1214–1219, 2023, [Online]. Available: http://j-ptiik.ub.ac.id
[4] D. D. K. Mahardika, “Peraturan Mentri Perdagangan Republik Indonesia Nomer 5 Tahun 2024,” no. February, pp. 4–6, 2024.
[5] U. Lenisa Rizki and I. Puji Astuti, “Jurnal Rekayasa Teknologi dan Komputasi,” vol. 1, pp. 17–31, 2025.
[6] I. Marina, D. Sukmawati, E. Juliana, and Z. N. Safa, “Dinamika Pasar Komoditas Pangan Strategis: Analisis Fluktuasi Harga Dan Produksi,” Paspalum J. Ilm. Pertan., vol. 12, no. 1, p. 160, 2024, doi: 10.35138/paspalum.v12i1.700.
[7] L. Grebe and D. Schiereck, Day-of-the-week effect: a meta-analysis, vol. 14, no. 4. Springer International Publishing, 2024. doi: 10.1007/s40822-024-00293-9.
[8] M. N. R. Ibrahim, “Price Forecasting of Shallots Using the Machine Learning Approach of Random Forest Regression Supporting Price Stabilization,” J. Keteknikan Pertan., vol. 13, no. 3, pp. 449–461, 2025, doi: 10.19028/jtep.013.3.449-461.
[9] D. I. Budiarti, G. Kholijah, S. Yurinanda, and B. Mardhotillah, “Prediksi Harga Cabai Rawit Hijau di Kota Jambi Menggunakan Rantai Markov,” J. Stat. Univ. Jambi, vol. 2, no. 1, 2023, [Online]. Available: https://online-journal.unja.ac.id/multiproximity
[10] S. A. Harjanto, S. Sa’adah, and G. S. Wulandari, “Export Commodity Price Forecasting in Indonesia Using Decision Tree, Random Forest, and Long Short-Term Memory,” J. Ilm. Tek. Elektro Komput. dan Inform., vol. 8, no. 4, p. 660, 2023, doi: 10.26555/jiteki.v8i4.25242.
[11] A. Widianti and I. Pratama, “Penanganan Missing Values dan Prediksi Data Timbunan,” RABIT J. Teknol. dan Sist. Inf. Univrab, vol. 9, no. 2, pp. 242–251, 2024.
[12] Y. Anzari et al., “Penerapan Algoritma K-Means Untuk Klasterisasi Pola Iklim Studi Kasus : Provinsi Jambi Periode 2020-2024,” vol. 6, no. 3, pp. 1037–1052, 2025, doi: 10.46576/djtechno.
[13] P. P. Allorerung, A. Erna, M. Bagussahrir, and S. Alam, “Analisis Performa Normalisasi Data untuk Klasifikasi K-Nearest Neighbor pada Dataset Penyakit,” JISKA (Jurnal Inform. Sunan Kalijaga), vol. 9, no. 3, pp. 178–191, 2024, doi: 10.14421/jiska.2024.9.3.178-191.
[14] G. Risky Pratiwi, D. Wahiddin, E. E. Awal, A. Fauzi, U. Buana, and P. Karawang, “Klasterisasi Tingkat Kemiskinan Kabupaten/Kota di Indonesia Menggunakan Algoritma K-Means dan K-Medoids,” J. Algoritm., vol. 21, no. 2, pp. 197–208, 2024, doi: 10.33364/algoritma/v.21-2.1788.
[15] J. W. Yuda, H. Audytra, and N. Mahmudah, “Sistem Klasifikasi Tingkat Kerusakan Kunci Motor Menggunakan Random Forest dengan Hyperparameter Tuning,” JURIKOM (Jurnal Ris. Komputer), vol. 12, no. 2, pp. 84–94, 2025, doi: 10.30865/jurikom.v12i2.8517.
[16] M. Y. T. Sulistyono, E. S. Pane, E. M. Yuniarno, and M. H. Purnono, “Hybrid Significant Stroke Feature: A Novel Stroke Feature Analysis Approach for Stroke Severity Classification of EEG Signals Based on Time Domain, Frequency Domain, and Signal Decomposition Domain,” Int. J. Intell. Eng. Syst., vol. 17, no. 6, pp. 1241–1267, 2024, doi: 10.22266/ijies2024.1231.91.
[17] N. Almajid, Y. Ginting, and A. I. Ramadhan, “Penerapan Decision Tree Regression dalam Memprediksi Harga Rumah di Provinsi Jawa Barat,” J. Ris. Inform. dan Teknol. Inf., vol. 1, no. 3, pp. 111–115, 2024, doi: 10.58776/jriti.v1i3.64.
[18] Y. Rokhayati, N. S. Utomo, and Sartikha, “Prediksi Kelayakan Operasional Mesin Rivet Menggunakan Regresi Linear Berganda,” J. Sustain. J. Has. Penelit. dan Ind. Terap., vol. 10, no. 1, pp. 10–15, 2021, doi: 10.31629/sustainable.v10i1.2336.
[19] F. E. Penalun, A. Hermawan, and D. Avianto, “Perbandingan Random Forest Regression dan Support Vector Regression Pada Prediksi Laju Penguapan,” J. Fasilkom, vol. 13, no. 02, pp. 104–111, 2023, doi: 10.37859/jf.v13i02.4976.
[20] S. A. Khoiri and A. Wahid, “Jurnal Sistem dan Teknologi Informasi Indonesia Analisis Kinerja Algoritma Machine Learning dalam Prediksi Harga Cryptocurrency Performance Analysis of Machine Learning Algorithms in Cryptocurrency Price Prediction,” vol. 9, no. 2, pp. 133–141, 2024.
[21] K. D. Sanjaya, “Prediksi Harga Rumah Dengan Metode Regresi Linear Dan Support Vector Regression Di Daerah Tebet Jakarta Selatan,” J. Komput. dan Inform., vol. 19, no. 2, pp. 95–102, 2024, [Online]. Available: https://journal.untar.ac.id/index.php/JKI/article/view/34588
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Mayang Adiani Erissafilla, MY Teguh Sulistyono

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 License (Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) ) that allows others to share the work with an acknowledgement 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 acknowledgement 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).








