Machine learning-driven strategies for wheat yield prediction and climate adaptation in Arid regions: a comparative analysis of random forest and XGBoost
摘要
This study evaluates machine learning approaches for predicting irrigated wheat yield in Khorasan Razavi Province, Iran, under varying climatic conditions, addressing the need for robust agricultural forecasting tools. We compared the performance of Random Forest (RF) and eXtreme Gradient Boosting (XGB) algorithms in predicting wheat yield and classifying yield categories (high, medium, low) across 20 counties. Models were trained on 70% of a multi-year dataset, with hyperparameter tuning via Grid Search and five-fold cross-validation, and validated on an independent 30% test set. Performance was assessed using RMSE, R², MAE, and Willmott’s agreement index (d). Yield classification accuracy was evaluated via confusion matrices. The RF model outperformed XGB in yield prediction (RMSE: 395.13 kg ha⁻¹, R²: 0.63 vs. RMSE: 492.21 kg ha⁻¹, R²: 0.56), while XGB showed slightly higher classification accuracy (69.8% vs. 68.9%), with RF being more robust for medium-yield classification. SHAP analysis identified key predictors, including growing season length, minimum daily temperature, and temperature seasonality. Partial Dependence Plots revealed nonlinear variable relationships, such as yield decline above 200 mm precipitation. This study provides the first county-level comparative evaluation of Random Forest and XGBoost models for irrigated wheat yield prediction in arid regions. We demonstrate that local-scale modeling substantially outperforms global models by explicitly capturing spatial heterogeneity, while also offering actionable agronomic insights for decision support in water-scarce environments. Overall, RF proved more robust for continuous yield prediction (RMSE = 395.13 kg ha⁻¹, R² = 0.63), whereas XGB showed marginally higher accuracy in yield classification. Integrating interpretable machine learning with climatic and agronomic data provides a powerful tool for enhancing agricultural decision-making under climate variability.