## 5 Case Analysis
### Early Warning of Construction Safety Risks  
(1) Set the parameters of algorithms  
The \(t_{max}\) of QPSO was set to 1000, and the \(N\) was set to 20 [18,20]. Moreover, the compression-expansion factors were set to \(\alpha_{1}=0.8\) and \(\alpha_{2}=0.4\). According to Equation (22),  
\[\alpha_{t}=0.4\bigg{(}1-\frac{t}{t_{max}}\bigg{)}+0.4. \tag{25}\]  
The range of the C is [0.01, 10], and the range of the width parameter \(\sigma\) of the kernel function is [10, 1000] [13]. The initial regularization parameter of the LSSVM is 2, and the initial width parameter is 30. (2) Find the optimal parameter combination of the LSSVM based on QPSO  
The normalized data and preset QPSO parameters were introduced into Equations (13)-(15) to initialize the optimization model of QPSO. Then, the normalized data and preset LSSVM calculation parameters were introduced into Equations (16)-(18) to initialize the LSSVM-based nonlinear early warning model. All the calculation programs were realized with the assistance of MATLAB 2016 software. The initial fitness function was calculated, and the particle position and global optimal solution were updated according to the fitness function. The fitness function of QPSO is shown in Figure 2.  
The QPSO found the optimal calculation parameters of LSSVM around the 120 th generation. The best regularization parameter was 1.742, and the best width parameter was 14.167. The iterative steps of QPSO around the 120 th generation were tracked in detail, as exhibited in Table 7.  
Table 7 reveals that QPSO found the optimal calculation parameters of the LSSVM in the 120 th generation. To examine the stability of QPSO calculations, the proposed model was recalculated 100 times. The QPSO found the best calculation parameters of LSSVM after 134.71 optimization times on average. \begin{table}
\begin{tabular}{c c c c c c c c} \hline
**Secondary index** & \(R_{11}\) & \(R_{12}\) & \(R_{13}\) & \(R_{14}\) & \(R_{15}\) & \(R_{21}\) & \(R_{22}\) \\ \hline Pearson correlation & \(-0.4871\) & \(-0.7124\) & \(0.5767\) & \(-0.7521\) & \(0.1574\) & \(0.8017\) & \(-0.2578\) \\ coefficient & \(R_{23}\) & \(R_{31}\) & \(R_{32}\) & \(R_{33}\) & \(R_{34}\) & \(R_{41}\) & \(R_{42}\) \\ \hline Pearson correlation & \(-0.7533\) & \(0.4297\) & \(0.8746\) & \(0.3325\) & \(-0.1247\) & \(0.7197\) & \(-0.5427\) \\ coefficient & \(R_{43}\) & \(R_{44}\) & \(R_{45}\) & \(R_{51}\) & \(R_{52}\) & \(R_{53}\) & \(R_{54}\) \\ \hline Pearson correlation & \(0.3475\) & \(0.2458\) & \(-0.3462\) & \(0.746\) & \(0.3024\) & \(-0.7003\) & \(-0.2467\) \\ coefficient & \(0.3475\) & \(0.2458\) & \(-0.3462\) & \(0.746\) & \(0.3024\) & \(-0.7003\) & \(-0.2467\) \\ \hline \end{tabular}
\end{table} 
Table 6: The correlations between the secondary indexes and risk early warning results. (3) Construction of the early warning model based on the LSSVM  
Among all data sets, 234 were randomly selected as training sets, and the remaining 27 were used as test sets. Thus, the ratio of the training sets to the test sets was 89.66%:10.34%. This ratio is discussed in detail in Section 6.3. All data and calculation parameters were introduced back into Equations (16)-(18), and the nonlinear early warning model based on the LSSVM was calculated. The calculation results of the test set are reported in Table 8. Sample data with the wrong prediction in Table 8 are bolded. \begin{table}
\begin{tabular}{c c c c c} \hline
**Iterations** & **Fitness of the k \(-\) 1** & **Fitness of the k** & **Accuracy** & **Continue?** \\  & **Iteration** & **Iteration** & **Iteration** & **Iteration** \\ \hline
118 & 0.0000084643 & 0.0000084643 & 0 \(<\) 0.0000001 & Yes \\
119 & 0.0000084643 & 0.0000071867 & 0.0000012776 \(>\) 0.0000001 & Yes \\
120 & 0.0000071867 & 0.0000001597 & 0.00000702070 \(>\) 0.0000001 & Yes \\
1000 & 0.0000001597 & 0.0000001597 & 0 \(<\) 0.0000001 & No \\ \hline \end{tabular}
\end{table} 
Table 7: Detailed QPSO update process.