In recent years, machine learning technology has achieved fruitful results in many fields. However, in the fields of credit scoring and medical treatment, due to the lack of interpretability of various algorithms, there is a lack of authoritative interpretation when dealing with security-sensitive tasks, resulting in bad decisions made by enterprises. While improving the prediction accuracy of the algorithm model, the interpretability of the algorithm model is enhanced, which is conducive to making optimal decisions. Therefore, it is proposed to use Borderline-SMOTE to balance the data, introduce the influence factor posFac to fine control the random number during the synthesis of new samples, and use Bayesian algorithm to optimize XGBoost. SHAP is used to explain and analyze the prediction results of the optimized XGBoost algorithm model, and the most influential eigenvalue of the output results of the algorithm model and the characteristics of the input eigenvalue of the algorithm model are solved. The experiment improves the prediction accuracy of XGBoost algorithm model and its interpretability, so as to further promote its research and wide application in various fields.