# Explainable Machine-Learning Predictions for Peak Ground Acceleration
## 4 Explanation of the Prediction Model Based on SHAP
### SHAP Global Analysis  
To verify the reliability and stability of the SHAP method, we used three machine learning models for SHAP analysis. Figure 12 shows summary plots of all features for three machine learning prediction models. The features are sorted according to the global importance, and the importance gradually decreases from top to bottom. The color of the points from blue to red represents the value of the features from small to large. Each point represents the SHAP value of a sample, which represents the contribution of the feature to a single prediction, and the set of points represents the direction and size of the overall influence of the feature on the prediction results. Figure 12a shows the summary plot for the XGBoost model. Among the four features, the PBA is the most important feature that affects the prediction results of the model, and a larger PBA generally contributes positively to the prediction results, which is consistent with the existing understanding that the greater the intensity of seismic input, the larger the PGA. D800 is the second most important feature, and a smaller D800 contributes positively to the prediction results, while a larger D800 has a negative SHAP value. The SHAP values of Bedrock \(V_{s}\) and FP are mainly concentrated around 0, and the influence of the two features on the SHAP value shows a reverse trend. The smaller Bedrock \(V_{s}\) is, the smaller the SHAP value, while the smaller the FP is, the larger the SHAP value. Figure 12b,c are summary plots of the random forest model and decision tree model, respectively. The feature importance ranking of the three prediction models is the same, and the change trend of the SHAP value is the same. The global importance of all input features for the three machine learning models is shown in Figure 13. It can be seen from Figure 13 that for the three models in this paper, the importance of the four input features is consistent. PBA is the most important factor, followed by D800 and Bedrock \(V_{s}\), and FP is the least important. Figure 12: The SHAP summary plot of all input features for (**a**) XGBoost, (**b**) Random Forest, (**c**) Decision Tree. Figure 13: Global importance of all input features for (**a**) XGBoost, (**b**) Random Forest, (**c**) Decision Tree. In order to show the distribution of SHAP values of different models more clearly, Figure 14 presents the distributions and densities of the features of XGBoost, Random Forest, and Decision Tree for the entire dataset. It can be seen from Figure 14 that the shape and distribution of the four features in the three machine learning models are similar, and the means of the SHAP values in different models are basically the same. The SHAP values of the four features are mainly concentrated in a certain range and each feature has positive and negative contributions. Figure 14a shows the density of SHAP values for XGBoost. It shows that the distribution of PBA and FP is concentrated, while D800 and Bedrock \(V_{\rm{s}}\) have two obvious peaks. The influence of each feature on PGA prediction results will not change with the different machine learning model. Through the global analysis of the SHAP values of the three machine learning models, it can be seen that the same feature has the same contribution to the prediction results on different models, and the distribution and densities of the SHAP values are basically the same. This is consistent with the objective knowledge and also confirms the reliability of SHAP in model explanation. In order to deeply understand the influence of each feature on the prediction results, the XGBoost model is taken as an example to show the dependency plots in Figure 15.  
Figure 15a shows the dependency plot of the PBA. It can be seen that the PBA is positively correlated with its SHAP value. The SHAP value is negative when the PBA is less than 0.015 g; that is, it plays a negative role in the prediction of PGA. When the PBA is greater than 0.015 g, the SHAP value is positive and has a positive effect on the PGA.