AUTHOR=Liu Bin TITLE=Modelling the spatial distribution of total nitrogen and phosphorus stock in dryland terrestrial ecosystems of China using machine learning algorithms JOURNAL=Frontiers in Environmental Science VOLUME=Volume 13 - 2025 YEAR=2025 URL=https://www.frontiersin.org/journals/environmental-science/articles/10.3389/fenvs.2025.1654154 DOI=10.3389/fenvs.2025.1654154 ISSN=2296-665X ABSTRACT=Nitrogen (N) and phosphorus (P) are essential limiting nutrients in dryland ecosystems, yet their storage and spatial patterns at regional scales remain poorly understood. This study aims to quantify the stocks and spatial distribution of soil and vegetation N and P across China’s drylands and to identify the dominant environmental drivers. Based on N and P density data from 4,200 soil and vegetation samples, along with environmental variables, we applied and evaluated four machine learning models. The random forest (RF) model demonstrated the best predictive performance and was selected for spatial prediction, achieving the highest R2 values (0.89, 0.92, 0.95, and 0.94) and the lowest MAE (3.21, 0.56, 5.37, and 2.23) and RMSE (5.09, 0.79, 7.05, and 2.98) for STN, STP, VTN, and VTP, respectively. The estimated stocks in the 0–30 cm soil layer across the entire dryland were 1111.4 Tg for soil total N (STN), 504.9 Tg for soil total P (STP), 17.6 Tg for vegetation total N (VTN), and 1.7 Tg for vegetation total P (VTP), all showing strong spatial heterogeneity. Spatial, climatic, soil, and vegetation variables together explained 42.2%, 37.6%, 33.9%, and 28.2% of the variance in STN, STP, VTN, and VTP, respectively. Soil properties—especially soil water content and sand content—were the primary factors regulating STN and STP variation, while climate, particularly mean annual precipitation, dominated the variation in VTN and VTP. This study provides critical baseline data for nutrient management and ecological restoration in dryland ecosystems.