Modeling Key Hydrochemical Drivers of Nitrogen Species (NO3− and NH4+) in the Yinchuan Plain Groundwater, China with XGBoost Model
摘要
Groundwater contamination by nitrogen species (NO3− and NH4+) poses a significant threat to water security and public health in the Yinchuan Plain, China. This chapter employs an eXtreme Gradient Boosting (XGBoost) machine learning model, interpreted via SHapley Additive exPlanations (SHAP) analysis, to identify the key hydrochemical drivers controlling their concentrations using a dataset of 134 groundwater samples. For NO3−, the model identified SO42−, NH4+, F−, and well depth as the most influential factors. The results indicate that high NO3− levels in shallow aquifers are primarily driven by anthropogenic sources, specifically agricultural fertilizers and irrigation, while denitrification and reduction processes in deeper, anoxic aquifers facilitate its attenuation. In contrast, NH4+ accumulation is predominantly governed by natural reducing conditions, with CODMn, Mn2+, and TFe as the key positive drivers. The XGBoost model revealed a strong non-linear inverse relationship with NO3− and an inverse impact from Ca2+ due to cation exchange, insights that were missed by traditional linear correlation analysis. The findings delineate two distinct contamination mechanisms: NO3− is a marker of surface agricultural pollution, whereas NH4+ is a product of subsurface geochemical conditions. This chapter provides a critical scientific basis for targeted groundwater management and underscores the superiority of machine learning in decoding complex hydrochemical interactions.