Kai Wang, Yahong Zhou, Jiayun Ji, Dan Wang, Tiantian Zhou
The Guanzhong Basin is a typical agricultural plain in China, where shallow groundwater nitrate contamination is jointly associated with multiple environmental factors. However, the dominant factors and their nonlinear response patterns remain unclear. In this study, shallow groundwater nitrate in the Guanzhong Basin was investigated using variables related to soil physicochemical properties, groundwater physicochemical parameters, hydrogeological conditions, climate, and land use/land cover. An XGBoost model optimized using particle swarm optimization (PSO) was combined with SHAP analysis to quantify the relative contributions and directions of association of environmental factors and to examine their condition-dependent combined patterns. The results showed that the PSO-XGBoost model effectively captured the nonlinear relationship between environmental factors and nitrate concentration, with satisfactory test-set performance (MAE = 1.3134, RMSE = 2.1502, R2 = 0.9163). SHAP analysis indicated that precipitation, depth to groundwater, electrical conductivity, and vadose-zone thickness were the key predictors of shallow groundwater nitrate concentrations in the study area. Precipitation and electrical conductivity generally made positive contributions, depth to groundwater made a negative contribution, and vadose-zone thickness showed a nonmonotonic response pattern. SHAP dependence analysis further suggested that paired factors exhibited condition-dependent associations in model-predicted nitrate concentrations, providing evidence to support groundwater nitrate-risk management in the Guanzhong Basin.