Analyzing meteorological effects on crop yield and yield prediction through machine learning with different data partitioning approaches: A case study from Czech Republic
Climate change and increasing weather variability pose significant challenges to agricultural productivity, particularly in temperate regions. This study examines climate impacts on yields of barley, rapeseed, rye, and wheat across the Czech Republic (2016–2024) using meteorological data and evaluates three machine learning models (Random Forest, Gradient Boosting, Support Vector Regression) for yield prediction solely on meteorological variables. Three validation strategies were tested: random (70/30%), spatial (region-based), and temporal (last three years). Random partitioning yielded the highest accuracy, but risks data leakage and is therefore not recommended for forecasting. Spatial partitioning showed low to moderate accuracy, suggesting ML approaches can partially interpolate yields in areas with no data (interpolation), particularly for barley and wheat. Temporal partitioning caused a substantial drop in predictive skill, producing unreliable forecasts for rye and rapeseed and indicating that meteorological data alone are insufficient for robust yield prediction. Support Vector Regression produced consistently negative R 2 values across all validation strategies, demonstrating fundamental model-task incompatibility. Wheat showed highest accuracy (random: 72.57 ± 7.19%; spatial: 53.45 ± 19.31%; temporal: 25.10%), driven largely by Year (>50% importance). Without Year, spatial R 2 dropped to 0.2–27%, confirming limited predictive power of meteorological variables alone. Crop climate analysis revealed distinct responses: rye was highly heat-sensitive, wheat and rapeseed benefited from late-season warmth, excess soil moisture during dormancy reduced rapeseed and wheat yields, and barley responded positively to stable warm conditions. These findings emphasize the importance of choosing an appropriate validation approach for yield prediction, depending on the intended task (interpolation or forecasting), as well as the value of feature interpretability. Key limitations include reliance on meteorology-only predictors without management or soil data, a small temporal test set (3 years, 42 observations per crop), and models' strong dependence on Year and Region features that limit operational forecasting utility. • Rye sensitive to Tmin (r≈–0.56); excess soil moisture reduces rapeseed/wheat yields • Random partitioning inflates performance; use spatial/temporal validation instead • Meteorological features alone achieved low R; SVR produced negative R 2 across all strategies • Year was key for wheat; excluding it dropped R 2 from 73 ± 7% to 20 ± 48%
Read more