Spatial prediction of coastal groundwater nitrate using combined feature selection and explainable machine learning.
Journal:
Journal of environmental management
Published Date:
Oct 23, 2026
(3)
Abstract
Groundwater nitrate contamination is an important issue affecting groundwater quality and safety. Accurate prediction of groundwater nitrate concentrations and identification of key influencing factors are of great significance for groundwater pollution prevention and water resource management. Taking the lower reaches of the Huangshui River as the study area, 452 groundwater samples collected in July 2023 were used to predict groundwater NO3--N concentrations by integrating Spearman correlation analysis, self-organizing map (SOM)-Boruta feature selection, Random Forest (RF), Extreme Gradient Boosting (XGBoost), RF-XGBoost stacking modeling, SHapley Additive exPlanations (SHAP), and geographic information system (GIS)-based spatial mapping. The dataset was divided into 361 training samples and 91 independent test samples, and model robustness was further assessed through cross-validation and 1000 repeated resampling runs. The SOM-Boruta method selected eight key variables: TDS, SO42-, TH, Cl-, NH3-N, COD, F- and pH. All three models showed good predictive ability, with the RF-XGBoost stacking model yielding the most favorable test-set performance (R2 = 0.881, RMSE = 13.266 mg/L, MAE = 9.284 mg/L).SHAP analysis identified TDS as the predictor with the highest contribution to model predictions across the three models. GIS-based RF-XGBoost prediction showed groundwater NO3--N concentrations ranging from 5.31 to 59.83 mg/L, with higher values in the north, lower values in the south and transitional values in the central area. These findings support groundwater nitrate spatial identification, water quality assessment and regional groundwater resource protection.
Authors
Keywords
No keywords available for this article.