Rice yield is an important part in a precision agriculture system that can support farmers' decision-making in a more targeted manner. The author's research aims to help farmers and stakeholders in Bambang Village predict crop yields accurately to overcome production fluctuations. Through appropriate efforts and strategies, this technology is expected to improve food security and farmer welfare. The research method uses the Support Vector Regression (SVR) algorithm for the modeling process, with the help of Particle Swarm Optimization (PSO) and Random Search optimization in finding the best parameters. The research dataset includes 1,120 historical data of rice harvests in Bambang Village for the 2022–2023 period tested through 70:30 and 60:40 data sharing scenarios. Model performance is evaluated using the Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE), and coefficient of determination (R2) metrics. The MAPE metric is used as the main indicator of relative accuracy by measuring the average percentage deviation between predicted values and actual values; a low MAPE value is very significant because it reflects the model has a minimal error rate on a percentage scale, thus providing more precise estimates for farmers. The results showed that both optimization methods successfully identified SVR parameters (C, gamma, epsilon) that followed the data trend. Random Search produced slightly superior R2 performance (reaching 82.20% at a 60:40 ratio), while PSO showed more consistent parameter exploration stability. These findings demonstrate that the integration of machine learning and optimization techniques has great potential in strengthening data-driven agricultural systems to improve food security and farmer welfare.