# Explainable Machine-Learning Predictions for Peak Ground Acceleration
## 3 Establishment of the Machine Learning Model
### Analysis of XGBoost Model Results  
The optimized model in Section 3.2 with 4 features (PBA, Bedrock \(V_{\text{s}}\), FP, and D800) was used to train and test the samples. The residuals (measured value minus predicted value) of the training set and the testing set were calculated, and the residual plots were plotted, as shown in Figure 9. To better show the trend of the residuals, we divided the PGA into 15 groups and calculated the average residual of each group, as shown in the black solid line in Figure 9. The dotted line is the average residual plus or minus one standard deviation. The PGA groupings and the corresponding number of earthquake records in each group are shown in Table 4. In order to ensure that the results are statistically significant, only the average residual value of the number of each group with five or more ground motions were calculated; that is, only the average value of the training dataset PGA ranging from 0.01 to 1.0 g and the testing dataset PGA ranging from 0.02 to 0.4 g is calculated. It can be seen from Figure 9 that, except for individual conditions, the residuals of most prediction results are within the range of \(\pm\)0.1 g. The average residuals of the training set and the testing set show a trend from negative to positive. When PGA is in the range of 0.01-0.05 g, the average residuals of the training set and the testing set are less than 0, and \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Evaluation**} & \multicolumn{2}{c}{**XGBoost**} & \multicolumn{2}{c}{**RF**} & \multicolumn{2}{c}{**DT**} \\ \cline{2-7}  & **Training** & **Testing** & **Training** & **Testing** & **Training** & **Testing** \\ \hline \(R^{2}\) & 0.945 & 0.915 & 0.921 & 0.901 & 0.888 & 0.787 \\ MAE & 0.012 & 0.014 & 0.013 & 0.015 & 0.013 & 0.017 \\ RMSE & 0.017 & 0.022 & 0.020 & 0.024 & 0.024 & 0.034 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Prediction results of three models. Figure 8: Determination of hyper-parameters for the XGBoost model. the predicted values are generally larger than the observation values. When the PGA is in the range of 0.05-1.0 g, the average residuals are positive, and the prediction results are underestimated. The standard deviation increases gradually with the increase in PGA, and the residual discreteness increases gradually. The main reason for this result may be that the number of large earthquakes is small, and the training of the model is not sufficient. Figure 10 is the statistical histogram of the ratio of the prediction and the observation of the XGBoost model. The horizontal coordinates in Figure 10 are the ratio of the predicted value to the observed value. It can be seen that the number of positive and negative 30% errors in the training dataset are about 40%, and the number of positive and negative 30% errors in the testing dataset are 45% and 35%, respectively. The training dataset is more balanced than the testing dataset. We collected the results of three numerical simulation methods, DEEPSOIL (DP), SHAKE2000 (SHAKE), and SOILRESPONSE (SR) [51], and compared them with the prediction results of machine learning models. The numerical simulation results in this paper are the author's previous research results [51]. Because there are no nonlinear parameters in the site data of the station, the generic nonlinear shear modulus reduction and damping curves were sourced from Darendeli [52]. DP and SHAKE methods are suitable for the site class II and site class III, and the calculation results are not good on the soft soil site. The calculation results of the SR method are better than DP and SHAKE [51]. It is worth noting that previous research results show that the linear equivalent method enters a strong nonlinear state on the large ground motion input, so the traditional linear equivalent method cannot simulate the site response well in this condition [15; 16].