Fluctuations in cayenne pepper prices in local markets are difficult to predict and often create uncertainty in farmers' decision-making. This study analyzes cayenne pepper price dynamics and develops a Random Forest-based prediction model using weekly price data (2021–2024) from four markets in East Lombok Regency: Pancor, Aikmel, Paok Motong, and Sakra. Predictor features included lagged prices (24 weeks), rolling mean and standard deviation (4-, 8-, and 12-week windows), and seasonal sine–cosine transformations. The dataset was split chronologically into training (80%) and testing (20%) sets to preserve temporal dependencies. The model achieved R² values of 0.86–0.93, with MAE of IDR 2,657–4,206 per kg and RMSE of IDR 3,519–4,946 per kg. It captured general price trends and seasonal patterns well but showed limited accuracy in predicting extreme price spikes, likely due to the inherent limitation of tree-based algorithms in extrapolating beyond historical training ranges and the absence of external variables such as supply volume. These findings indicate that cayenne pepper price dynamics follow learnable historical patterns, and the model has potential as a data-driven decision-support tool to help reduce, though not eliminate, market uncertainty and support local food security
Copyrights © 2026