# Optimization Design Method of Pipe-Insulating Joints Based on Surrogate Model and Genetic Algorithm
## 3 Results  
### Surrogate Model Evaluation Results  
The selection of hyperparameters is a crucial factor influencing the performance of an algorithm. This study determines the hyperparameters using the GridSearchCV function, which encompasses grid search and cross-validation. This involves sequentially adjusting parameters within a specified range, training the learner with the adjusted parameters, and evaluating each combination with cross-validation to identify the parameter set that yields the highest accuracy on the validation set [42]. During the cross-validation process, the data is divided into several subsets, with each subset serving as both training and validation data. Therefore, there is no need to specifically reserve a separate validation set. Utilizing GridSearchCV to determine the hyperparameters of four algorithms, the primary parameters for each algorithm are identified as follows. The hyperparameter \(\alpha\) is set to 1 for the ridge regression, and the polynomial degree is 6. For the KNN, the hyperparameter K is designated as 6 without considering distance weighting. Regarding the DT, variance is adopted as the criterion for node splitting, with a maximum depth of 8 for the decision tree. For the GBDT, the maximum depth is 32, the maximum number of leaves is 64, and the learning rate is 0.2. The MAE, RMSE, and \(R^{2}\) values for each algorithm on the training and test sets are presented in Table 4, while those for the random test set are shown in Table 5. The absolute and relative errors of different algorithms on the random test set are shown in Figures 9 and 10, respectively. The absolute stress error equals the predicted stress minus the actual stress, and the relative stress error equals the absolute stress error divided by the actual stress. In Figure 10, data points that lie on the zero-error line indicate that the predicted values are equal to the actual values; the farther away a point is from the zero-error bars, the greater the error in the predicted values. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Algorithm Type**} & \multicolumn{2}{c}{**MAE**} & \multicolumn{2}{c}{**RMSE**} & \multicolumn{2}{c}{\(\boldsymbol{R^{2}}\)} \\ \cline{2-7}  & **Training Set** & **Test Set** & **Training Set** & **Test Set** & **Training Set** & **Test Set** \\ \hline Ridge regression & 19.704 & 22.882 & 38.563 & 60.115 & 0.993 & 0.981 \\ \hline KNN & 57.261 & 77.789 & 175.502 & 286.975 & 0.830 & 0.679 \\ \hline DT & 14.482 & 19.993 & 25.730 & 38.758 & 0.996 & 0.991 \\ \hline GBDT & 2.766 & 23.402 & 5.824 & 55.864 & 0.999 & 0.985 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Prediction performance of different algorithms on training and test sets. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multicolumn{1}{c}{**Evaluation Indicators**} & \multicolumn{1}{c}{**Ridge Regression**} & **KNN** & **DT** & **GBDT** \\ \hline MAE & 16.526 & 24.412 & 24.312 & 29.653 \\ \hline RMSE & 23.719 & 54.040 & 44.097 & 45.647 \\ \hline \(R^{2}\) & 0.928 & 0.627 & 0.751 & 0.733 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Prediction performance of different algorithms on random test sets. Figure 9: Absolute stress error. As can be seen from Table 4, for the training set, the \(R^{2}\) values for ridge regression, DT, and GBDT algorithms are all greater than 0.99, and the maximum MAE and RMSE are 19.704 and 38.563, respectively. This indicates that these three algorithms fit the training set well and can accurately identify the relationship between input features and the target in the training data. For the test set, the predictive performance of all four algorithms has declined to some extent. However, aside from the KNN algorithm, the other three algorithms still demonstrate excellent predictive performance on the test set. The \(R^{2}\) values are more significant than 0.98. The KNN algorithm performed the worst in both the training and test sets, with an \(R^{2}\) of only 0.679 in the test set and MAE and RMSE of 77.789 and 286.975, respectively.