A machine learning approach to estimating nitrate-nitrogen concentrations in shallow groundwater across New Zealand
Nitrate contamination of shallow groundwater is a concern for drinking water safety and ecosystem health globally, yet national-scale prediction techniques remain limited. Here, we describe the development and evaluation of an ensemble machine learning framework to estimate median nitrate (NO 3 -N) concentrations in shallow groundwater across New Zealand. From 957 state of the environment monitoring bores, 589 shallow (<50 m), oxic bores with complete model data were retained. These were combined with 99 predictor variables describing land use, hydrogeology, climate, topography, and soils. Candidate tree-based machine learning models (RF, XRT, XGBoost, LightGBM) were trained and stacked into an ensemble, evaluated with 10-fold cross-validation repeated 10 times within the training set. On the held-out 20% test set, the ensemble model achieved an RMSE of 3.13 mg/L NO 3 -N and R 2 of 0.56, indicating moderate performance. Soil age, dairy cattle density, land use, and bore depth were amongst the strongest predictors of median groundwater nitrate. Gridded estimates indicated a pattern of increased concentrations in intensively farmed areas, with hotspots exceeding the drinking water standard of 11.3 mg/L, though high concentrations were systematically underestimated. This approach demonstrates the first spatially continuous, data-driven estimates of median nitrate in shallow groundwater across New Zealand, offering a tool to inform water quality management and resource management. The machine learning framework can be applied in other regions where monitoring data are sparse but environmental predictors exist.
Authors
- Isaac A. Bain (ORCID: https://orcid.org/0000-0002-6755-3721)
- Simon Hales (ORCID: https://orcid.org/0000-0002-4529-7595)
- Tim Chambers (ORCID: https://orcid.org/0000-0001-5856-5600)
- Christopher J. Daughney
Institutions
- Statistics New Zealand (NZ)
- University of Canterbury (NZ)
- Education New Zealand (NZ)
- University of Otago (NZ)
Publication Details
- Journal
- Chemosphere
- Published
- 2026-09-10
- DOI
- https://doi.org/10.1016/j.chemosphere.2026.145093
- Primary Topic
- Groundwater and Isotope Geochemistry
- Type
- article
- Field-Weighted Citation Impact
- 0.00