Shallots (Allium cepa L.) are a major horticultural commodity in Indonesia, with a production of 1.98 million tons in 2022, representing 13.59% of the total national vegetable production. Accurate forecasting of agricultural commodity prices is fundamental to sustainable development in the agricultural sector and contributes to broader economic stability. This study uses the random forest regression algorithm, a supervised machine learning technique that utilizes ensemble learning to combine multiple decision trees. This approach offers advantages in modeling non-linear relationships for agricultural price prediction while also reducing the risk of overfitting, resulting in more accurate and stable forecasts compared to individual decision trees. The purpose of this research is to develop and optimize a shallot price forecasting model using random forest regression. The optimized model, using 50 decision tree estimators, successfully predicted up to 15 months ahead of monthly prices and achieved an RMSE of 2363.15 and a MAPE of 8.71% in validation, then a MAPE of 10.31% in test evaluation.
Copyrights © 2025