## 4 The Early Warning Model
### The Proposed Prediction Model  
Step 1: Data collection and preprocessing  
Data are obtained by on-site investigation and the consultation of construction logs and project management documents. Qualitative index data should be tested for reliability and validity. To reduce the complexity of the modeling calculation of the LSSVM, the extreme value normalization method is adopted to standardize the data. For benefit-based indicators [31]:  
\[x_{ij}^{*}=\frac{x_{ij}-\min(x_{j})}{\max(x_{j})-\min(x_{j})}. \tag{19}\]  
For cost-based indicators [31]:  
\[x_{ij}^{*}=\frac{\max(x_{j})-x_{ij}}{\max(x_{j})-\min(x_{j})}, \tag{20}\]  
where \(x_{ij}\) is the data of the \(j\)-th indicator of the \(i\)-th early warning object, \(\min(x_{j})\) represents the minimum value of the data of the \(j\)-th indicator, \(\max(x_{j})\) represents the maximum value of the data of the \(j\)-th indicator, and \(x_{ij}^{*}\) is the normalized data. Step 2: Linear correlation analysis  
Choosing the linear or nonlinear modeling method is the first step of early risk warning. In this study, the Pearson correlation coefficient is selected to analyze the correlations between early warning indicators and early warning results. Its calculation formula is as follows [31]:  
\[r=\frac{-\sum_{i=1}^{n}(x_{i}-\overline{x})(y_{i}-\overline{y})}{\sqrt{\sum_{i= 1}^{n}(x_{i}-\overline{x})^{2}(y_{i}-\overline{y})^{2}}}, \tag{21}\]  
where \(x_{i}\) is the value of a certain early warning variable, \(\overline{x}\) is the average value of a certain variable, \(y_{i}\) is the risk early warning result, and \(\overline{y}\) is the average value of the risk early warning result. If \(r\) is greater than 0.7, there is only a certain linear correlation; if \(r\) is less than 0.7, there is almost no linear correlation [32]. In this work, 70% is set as the threshold for selecting the modeling method. When more than 70% of the early warning indicators have an obvious linear relationship with the risk early warning results, the linear modeling method should be used for risk prediction. If most of the early warning indicators are linearly related to the results, it is suggested to adopt a linear modeling method or re-collect data. Step 3: Searching for the optimal parameters of the LSSVM based on QPSO  
1. Setting the calculation parameters of QPSO and the LSSVM. Excluding the total number of particles \(N\) and the maximum number of iterations \(t_{max}\) in the population, the QPSO has only one parameter, namely the compression-expansion factor \(\alpha(t)\). To simplify the algorithm to the greatest extent, the value strategy of \(\alpha\) linear reduction is chosen for use [20]:  
\[\alpha(t)=\frac{(\alpha_{1}-\alpha_{2})(t_{max}-t)}{t_{max}}+\alpha_{2}, \tag{22}\]  
where \(\alpha_{1}\) and \(\alpha_{2}\) are the initial and termination values of \(\alpha\), respectively, and \(\alpha_{1}>\alpha_{2}\) is satisfied. It should be emphasized that the selection of calculation parameters of QPSO generally only affects the calculation efficiency of the algorithm and has little effect on the optimization results. In the LSSVM, the regularization parameter and the width parameter of the kernel function are randomly given. However, the range of parameters should be as large as possible, so that the optimal parameter combination can be found. 2. Initializing the calculation model  
The ratio of the training and test sets is set according to the research needs. The common ratios were 95%:5%, 90%:10%, 80%:20%, and 70%:30%. The optimization model of QPSO is initialized according to Equations (13)-(15), and the nonlinear early warning model of the LSSVM is initialized according to Equations (16)-(18). 3. Calculating the fitness function  
The regularization parameter and the width parameter are used as the solution dimensions in QPSO. The optimal kernel function parameters and penalty factor parameters in each iteration of QPSO are trained as the parameters of the LSSVM model, and the fitness values of all particles are calculated by the fitness function.