Abstract:Soil pH is one of the basic properties of soil, which plays an important role in soil environmental management. In anhui Province, 17 environmental variables such as climate, topography and biology were selected to establish a spatial prediction model of soil pH in Anhui Province using XGBoost and random forest model. The prediction accuracy of the two models was compared, and the uncertainty of the two mapping results was estimated. The results showed that compared with random forest model, XGBoost model was more accurate in predicting soil pH in Anhui Province. Eta, MAX_depth, and NRounds all have a certain impact on the accuracy of XGBoost model, and the change of ETA has the greatest impact on the accuracy of XGBoost model. MAP, Y, MRVBF, MAT, MRRTF and EVI have great influence on soil pH modeling, and they are all important in the order of variable importance of the two models. The results of spatial mapping showed that the prediction results of the two models had the same general trend -- the soil pH in Anhui province showed a trend of "southern acid and northern alkali", but the results of the two models were different in some areas.