Abstract:【Objective】To improve the accuracy and reliability of digital soil class mapping in complex regions, this study verifies the application effect of locally weighted machine learning models using Shanxi Province as a case study. 【Method】Based on representative profile data from the Second National Soil Survey, this study integrated multi-source environmental covariates including topography, climate, and vegetation. Key environmental variables were screened using Random Forest (RF) importance ranking. Subsequently, Geographically Weighted Random Forest (GWRF) and standard RF models were constructed for soil classification mapping. The impact of local weighting on mapping accuracy and model uncertainty was comprehensively evaluated using multi-dimensional metrics, including Overall Accuracy (OA), Kappa coefficient, Multiclass Brier Score (MBS) . 【Result】The results indicated that: (1) The distribution of soil types in Shanxi Province was co-dominated by parent material, soil texture, and elevation. The driving mechanisms differed significantly among soil types: Cinnamon soils and Aeolian soils were significantly influenced by texture; Mountain Meadow soils and Brown soils showed obvious vertical zonality; while Paddy soils were closely related to hydrological conditions. (2) Compared with the RF model, the GWRF model significantly improved mapping accuracy. The OA increased from 66% to 72%, the Kappa coefficient increased from 0.61 to 0.67. (3) Uncertainty and probability assessments showed that the MBS of the GWRF model was 0.47 (superior to 1.42 for the RF model), indicating that local weighting effectively reduced model uncertainty. The northern and eastern mountainous areas were identified as regions with high uncertainty.【Conclusion】This study confirms that locally weighted models can effectively improve the accuracy and reliability of digital soil class mapping in complex regions.