## 5 Prediction Model of Productivity Ratio for Perforated Wells
### Results Analysis  
Based on the aforementioned model, the PSO is employed to optimize the parameters of the LSSVM in the prediction of the productivity ratio for perforated wells. The PSO error curve is depicted in Figure 9, where the horizontal axis represents the epoch, and the vertical axis represents the test set RRMSE. The figure demonstrates that the PSO algorithm achieves a relatively ideal solution in less than 10 steps, while the global optimal solution is attained in approximately 90 steps, indicating rapid convergence. The total time consumed is approximately 11 h, 44 min, and 56.3163 s. The optimized values for the parameters c and \(\sigma\) are determined as 500.428 and 0.554, respectively. By substituting these optimized parameters into the LSSVM model for predicting the productivity ratio, the test set RRMSE is found to be 0.0004567.  
For comparison, the grid search algorithm is also employed to optimize the parameters of the LSSVM. The penalty factor C is selected within the optimization range of 0.001 to 1000, with a step size of 1, while the kernel width \(\sigma\) is selected within the optimization range of 0.001 to 10, with a step size of 0.5. The entire optimization process requires a total of 20,000 steps to complete, taking approximately 24 h, 26 min, and 54.0125 s. The optimized values for c and \(\sigma\) are determined as 500.001 and 0.501, respectively. By utilizing these obtained parameters to reconstruct the productivity ratio prediction model, the test set RRMSE is found to be 0.0005501.  
\begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Value** \\ \hline Perforation depth (mm) & 100, 300, 500, 700 \\ Perforation diameter (mm) & 8, 10, 12, 14 \\ Shot density (shots/m) & 8, 16, 24, 32 \\ Thickness of the compacted zone (mm) & 10, 12, 14, 16 \\ Permeability reduction coefficient of the compacted zone & 0.1, 0.2, 0.3, 0.4 \\ \hline \end{tabular}
\end{table}
Table 1: Input parameters of the numerical model.  
Table 2 presents the time, test set RRMSE, and final model parameters for predicting the productivity ratio using the two optimization algorithms. It is evident that the PSO algorithm outperforms the grid search algorithm in terms of computational efficiency and accuracy.  
In order to determine the optimal predictive model for the productivity ratio of perforated wells, this study also combines PSO with an Artificial Neural Network (ANN) and Random Forest (RF) to establish corresponding machine learning models. In addition to the RRMSE, the R2 (determination coefficient) and MAPE (mean absolute percentage error) are also used as statistical evaluation indicators for the three machine learning models, as shown in Table 3 and Figure 10. It is evident that among the three models, the machine learning model based on PSO-LSSVM performs the best.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithm** & **Time** & **RRMSE** & \
\begin{tabular}{c} **Parameters** \\ **C** \\ \end{tabular} &
\begin{tabular}{c} **\(\sigma\)** \\ \end{tabular} \\ \hline PSO & 11:44:56.3163 & 0.0004567 & 500.428 & 0.554 \\ Grid Search & 24:26:54.0125 & 0.0005501 & 500.001 & 0.501 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Comparison of results between the PSO and grid search.  
Figure 10: Comparison of the ranking scores of the three machine learning models.  
Figure 9: Process of optimization based on the PSO.  
The comparison of the predicted values and actual values for the productivity ratio based on the PSO-LSSVM, is presented in Figure 11. It is evident that the predicted values closely match the actual values, indicating a high predictive capability of the PSO-LSSVM model. Therefore, the combination of PSO and LSSVM to establish a predictive model for the productivity ratio of perforated wells is proven to be effective and feasible.