The Random Forest Regression for Price Prediction and Profitability Analysis in a Mushroom Sales Enterprise System

Random Forest Regression-Based Enterprise Sales System for Mushroom Price Forecasting and Profitability Analysis

Authors

  • Ulya Ilhami Arsyah Politeknik Negeri Padang
  • Dian Eka Putra Politeknik Negeri Padang
  • Defni Politeknik Negeri Padang
  • Ikhsan Politeknik Negeri Padang
  • Ainil Mardiah Politeknik Negeri Padang

DOI:

https://doi.org/10.24036/jtip.v20i1.1157

Keywords:

▪ Random Forest Regression, Price prediction, Profitability analysis, Enterprise system, Machine learning

Abstract

Mushroom processing enterprises managed by community groups in Limau Manis Village, Pauh District, frequently fail to survive because producers lack a reliable basis for setting selling prices and estimating profit. This study aimed to develop an enterprise system that applies the Random Forest Regression method to predict the selling price of processed mushroom products and to analyze business profitability. The dataset consisted of daily sales records of three processed products (chips, nuggets, and floss) collected from an industry partner during 2023–2024, covering product type, product weight, production cost, packaging type, season, selling price, and units sold. The research stages comprised requirements analysis, model design, evaluation, deployment, and profit analysis. The model was built with 100 estimators and evaluated using Mean Absolute Error (MAE) and the coefficient of determination (R²). The evaluation produced an MAE of Rp 2,031 (approximately 14% of the average selling price) and an R² of 0.63, indicating that the model explains 63% of selling price variation. The model was deployed as a Streamlit-based web application that generates price predictions, profit estimates, and visual analyses of profit per transaction and profit over time. The system supports mushroom entrepreneurs in making more objective, data-driven pricing decisions.

References

Badan Pusat Statistik, Statistik Hortikultura 2022. Jakarta, Indonesia: BPS RI, 2023.

M. Fafchamps, “Cash crop production, food price volatility, and rural market integration in the third world,” Am. J. Agric. Econ., vol. 74, no. 1, pp. 90–99, 1992.

M. K. Mohanty, P. K. G. Thakurta, and S. Kar, “Agricultural commodity price prediction model: A machine learning framework,” Neural Comput. Appl., vol. 35, pp. 15109–15128, 2023, doi: 10.1007/s00521-023-08528-7.

K. Srivastava, R. Sharma, and P. Singh, “House price prediction using machine learning,” in Proc. 3rd Int. Conf. Advances in Computing, Communication Control and Networking (ICAC3N), 2021, pp. 203–206, doi: 10.1109/ICAC3N53548.2021.9725552.

L. Breiman, “Random forests,” Mach. Learn., vol. 45, no. 1, pp. 5–32, 2001, doi: 10.1023/A:1010933404324.

T. K. Ho, “Random decision forests,” in Proc. 3rd Int. Conf. Document Analysis and Recognition, Montreal, QC, Canada, 1995, pp. 278–282, doi: 10.1109/ICDAR.1995.598994.

M. Rakhra et al., “Crop price prediction using random forest and decision tree regression: A review,” Mater. Today Proc., 2021, doi: 10.1016/j.matpr.2021.03.261.

R. K. Paul et al., “Machine learning techniques for forecasting agricultural prices: A case of brinjal in Odisha, India,” PLOS ONE, vol. 17, no. 7, e0270553, 2022, doi: 10.1371/journal.pone.0270553.

Z. Chen, H. S. Goh, K. L. Sin, K. Lim, N. K. H. Chung, and X. Y. Liew, “Automated agriculture commodity price prediction system with machine learning techniques,” Adv. Sci. Technol. Eng. Syst. J., vol. 6, no. 4, pp. 376–384, 2021.

M. N. R. Ibrahim, “Price forecasting of shallots using the machine learning approach of random forest regression supporting price stabilization,” J. Keteknikan Pertanian, vol. 13, no. 3, pp. 449–461, 2025.

I. R. Muchtar and A. Afiyati, “Comparison of linear regression and random forest algorithms for premium rice price prediction (case study: West Java),” J. Indones. Sos. Teknol., vol. 5, no. 7, pp. 3122–3132, 2024, doi: 10.59141/jist.v5i7.1184.

M. A. Pratama, M. Munawaroh, and W. J. Pranoto, “Perbandingan performa algoritma linear regresi dan random forest untuk prediksi harga bawang merah di Kota Samarinda,” Tektonik, vol. 3, no. 2, p. 172, 2024, doi: 10.62017/tektonik.

E. S. Lestari and I. Astuti, “Penerapan random forest regression untuk memprediksi harga jual rumah dan cosine similarity untuk rekomendasi rumah pada Provinsi Jawa Barat,” J. Ilmiah FIFO, vol. 14, no. 2, p. 131, 2022, doi: 10.22441/fifo.2022.v14i2.003.

A. N. Rais, Warjiyono, I. Alfarobi, S. Wira Hadi, and W. Kurniawan, “Analisa prediksi harga jual rumah menggunakan algoritma random forest machine learning,” J. Riset Sist. Inf. Teknol. Inf. (JURSISTEKNI), vol. 6, no. 2, pp. 416–423, 2024.

D. R. Lestari, E. A. S. Bangun, F. L. Gaol, and T. Matsuo, “Machine learning-based forecasting of agricultural commodity prices using ensemble models,” J. Hum. Earth Future, vol. 6, 2025.

P. Probst, M. N. Wright, and A.-L. Boulesteix, “Hyperparameters and tuning strategies for random forest,” WIREs Data Min. Knowl. Discov., vol. 9, no. 3, e1301, 2019, doi: 10.1002/widm.1301.

F. Pedregosa et al., “Scikit-learn: Machine learning in Python,” J. Mach. Learn. Res., vol. 12, pp. 2825–2830, 2011.

D. Chicco, M. J. Warrens, and G. Jurman, “The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation,” PeerJ Comput. Sci., vol. 7, e623, 2021, doi: 10.7717/peerj-cs.623.

T. O. Hodson, “Root-mean-square error (RMSE) or mean absolute error (MAE): When to use them or not,” Geosci. Model Dev., vol. 15, no. 14, pp. 5481–5487, 2022, doi: 10.5194/gmd-15-5481-2022.

Menteri Agama, Menteri Ketenagakerjaan, and Menteri PANRB Republik Indonesia, Keputusan Bersama tentang Hari Libur Nasional dan Cuti Bersama Tahun 2023 (beserta perubahannya) dan Tahun 2024 (No. 855, 3, 4 Tahun 2023). Jakarta, Indonesia, 2022–2023.

Badan Pusat Statistik Kota Padang, “Perkembangan Indeks Harga Konsumen Kota Padang, Januari–Desember 2024,” Berita Resmi Statistik, Padang, Indonesia, 2024.

A. E. Hoerl and R. W. Kennard, “Ridge regression: Biased estimation for nonorthogonal problems,” Technometrics, vol. 12, no. 1, pp. 55–67, 1970, doi: 10.1080/00401706.1970.10488634.

T. Chen and C. Guestrin, “XGBoost: A scalable tree boosting system,” in Proc. 22nd ACM SIGKDD Int. Conf. Knowledge Discovery and Data Mining, 2016, pp. 785–794, doi: 10.1145/2939672.2939785.

J. Bergstra and Y. Bengio, “Random search for hyper-parameter optimization,” J. Mach. Learn. Res., vol. 13, pp. 281–305, 2012.

R. Kohavi, “A study of cross-validation and bootstrap for accuracy estimation and model selection,” in Proc. 14th Int. Joint Conf. Artificial Intelligence (IJCAI), 1995, pp. 1137–1143.

C. Bergmeir and J. M. Benítez, “On the use of cross-validation for time series predictor evaluation,” Inf. Sci., vol. 191, pp. 192–213, 2012, doi: 10.1016/j.ins.2011.12.028.

Streamlit Inc., “Streamlit: A faster way to build and share data apps,” 2024. [Online]. Available: https://streamlit.io.

Downloads

Published

2026-11-14

How to Cite

[1]
U. I. Arsyah, D. E. Putra, Defni, Ikhsan, and A. Mardiah, “The Random Forest Regression for Price Prediction and Profitability Analysis in a Mushroom Sales Enterprise System: Random Forest Regression-Based Enterprise Sales System for Mushroom Price Forecasting and Profitability Analysis”, J. teknol. inf. pendidik., vol. 20, no. 1, pp. 134–150, Nov. 2026.