## 5 Test-Result Analysis
### Prediction-and-Evaluation System of Mechanical Properties of Steel Anchor Box Based on PSO-BP
#### 6.2.2 PSO-BP Prediction Model
The shear-stress-inhomogeneity coefficient, the ratio of the force transfer, the maximum shear stress of the weld, and the ratio of four total force transfers were used as the output-evaluation variables, and the number of output nodes was 13. In order to minimize the training error, the number of hidden-layer nodes was determined using Equation (6). The final topology determined in this paper was 4-10-13. \[L<\sqrt{a+b}+c \tag{6}\]  
where \(L\) is the number of neurons in the hidden layer, \(a\) is the number of neurons in the output layer, \(b\) is the number of neurons in the input layer, and \(c\) is in the range of [0; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20], where a constant is taken. The cross-validation method was used in this research to divide 70% of the data into the training set, 15% into the validation set, and the remaining 15% into the test set, and the consistency of the data distribution was maintained in the data division. The statistical parameters of each data set are shown in Tables 8 and 9. The activation function of the BP neural network from the input layer to the hidden layer was logsig, and the function of the hidden layer to the output layer was the purlin function. The training function was the default trainlm function, which is a method that combines [PERSON]'s method and gradient descent, and can improve the training speed and accuracy when training neural networks; the learning function was the default learngdm function, which is a gradient descent with a momentum weight and bias-learning function, which can update the weights and biases of a neural network according to the gradient of the network's performance, and can use the momentum factor to accelerate the convergence process. According to the PSO algorithm, the initial position and velocity of the particles were generated randomly within the allowed range. The population size was 40 and the inertia weight was set to 1. The learning factor used \(c_{1}=c_{2}=2.5\). The weights and thresholds of the trained PSO-BP network model are shown in Appendix A. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multirow{2}{*}{\
\begin{tabular}{c} **Sample** \\ **Size** \\ \end{tabular} } & \multirow{2}{*}{
\begin{tabular}{c} **Statistical** \\ **Parameters** \\ \end{tabular} } & **X1** & **X2** & **X3** & **X4** \\  & & & **Thickness of** & **Length of N1,** & **Thickness of** & **Designed Load-Bearing** \\  & & & **N1, N2** & **N2** & **N7** & **Cable Force** \\ \hline \multirow{4}{*}{Training set} & \multirow{4}{*}{263} & Max & 34 & 2000 & 46 & 7000 \\  & & Min & 30 & 1600 & 38 & 4000 \\ \cline{1-1}  & & Average & 32.027 & 1803.064 & 42.027 & 5371.212 \\ \cline{1-1}  & & Stdev.s & 1.636 & 159.026 & 2.780 & 1068.271 \\ \hline \multirow{4}{*}{Validation set} & \multirow{4}{*}{56} & Max & 34 & 2000 & 46 & 7000 \\  & & Min & 30 & 1600 & 38 & 4000 \\ \cline{1-1}  & & Average & 32.158 & 1804.737 & 42.000 & 5344.737 \\ \cline{1-1}  & & Stdev.s & 1.667 & 142.748 & 3.013 & 1064.693 \\ \hline \multirow{4}{*}{Test set} & \multirow{4}{*}{56} & Max & 34 & 2000 & 46 & 7000 \\ \cline{1-1}  & & Min & 30 & 1600 & 38 & 4000 \\ \cline{1-1}  & & Average & 31.632 & 1780.263 & 41.684 & 5418.421 \\ \cline{1-1}  & & Stdev.s & 1.636 & 137.930 & 3.103 & 1063.128 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Statistical parameters of input variables. Prediction Results and Discussion  
In this paper, two different evaluation indicators, namely, the mean squared error (_MSE_) and the Nash efficiency coefficient (_NS_), were used with the following mathematical expressions:  
\[MSE=\frac{1}{n}\sum_{i=1}^{n}\left(x_{i}-p_{i}\right)^{2} \tag{7}\]  
\[NS=1-\frac{\sum_{i=1}^{n}\left(x_{i}-p_{i}\right)^{2}}{\sum_{i=1}^{n}\left(x_{i }-\overline{x}\right)^{2}} \tag{8}\]  
where \(x_{i}\) is the true value, \(p_{i}\) is the predicted value, and \(x\) is the average of the true values. The calculation results are shown in Table 10, below.