Blocked and Hierarchical Cross-Validation for Agricultural Data with Spatial Autocorrelation: Application to Peru’s National Agricultural Survey
摘要
Spatial autocorrelation in agricultural data poses a critical methodological challenge for predictive model validation, since conventional techniques assume independence between observations. This study implements and evaluates blocked and hierarchical cross-validation for livestock inventory data from Peru’s 2017 National Agricultural Survey (n = 69,645), comparing them with traditional random cross-validation. Results show weak but statistically significant spatial autocorrelation (Moran’s I = 0.0031, p = 0.0401). Random cross-validation overestimates predictive performance by 9.1% (RMSE) and 25.1% (R2) compared to blocked validation, demonstrating moderate spatial leakage. Hierarchical cross-validation provides statistically equivalent estimates but is computationally more expensive (60× longer runtime). RMSE by geographic domain varies between 0.884 and 1.210 (36.9% variation), revealing substantial spatial heterogeneity. Findings validate the need for spatially-aware validation methods and demonstrate that simple blocked cross-validation provides optimal balance between rigor and efficiency.