# Quality Prediction and Parameter Optimisation of Resistance Spot Welding Using Machine Learning
## 4 Results and Discussion
### Comparison of the Impact of Predictive Model Algorithms on Model Performance  
To verify whether the introduction of CGO into the MLSSVR prediction model improved the predictive ability of the regression model, it was compared with the traditional MLSSVR model and the GRNN neural network model. For the parameter selection of the model, the traditional MLSSVR model uses the grid search method and the leave-one-out method for the hyperparameter search, the best hyperparameter being \(\theta=\{-5,\,-6,\,-3\}\). The GRNN selects the 10-fold cross-validated fitness value of 0.9 as the best fitness value after multiple debugging. In contrast, regression models and neural network models use the same training and test sets to predict the quality of welding. Specific results for the CGO-MLSSVR, MLSSVR, and GRNN neural network models of the actual values and predicted values are shown in Figures 10 and 11. Figure 11: Comparison of the accuracy of the predicted tensile shear load of different models. (**a**) CGO–MLSSVR prediction model; (**b**) MLSSVR prediction model; (**c**) GRNN prediction model. Figure 10: Comparison of the accuracy of the predicted nugget diameter of different models. (**a**) CGO–MLSSVR prediction model; (**b**) MLSSVR prediction model; (**c**) GRNN prediction model. Figure 9: Method II validation figure. (**a**) No. 1 validation figure; (**b**) No. 2 validation figure. From Figures 10 and 11, it can be seen that the prediction performance of CGO-MLSSVR is more consistent between the predicted and experimental values and demonstrates the best prediction ability. The average relative errors of CGO-MLSSVR and MLSSVR are 2.6% and 3.6%, respectively, in predicting the nugget diameter, while the average relative error of GRNN is 7.72%; the prediction performances of CGO-MLSSVR and MLSSVR are, therefore, significantly better than that of the GRNN neural network. In terms of predicting tensile shear load, all three prediction models have different degrees of deviation, but the error of the GRNN prediction model is greater, while those CGO-MLSSVR and MLSSVR are similar to each other. To accurately analyse and compare the performance of different prediction models, the evaluation criteria for the models were selected as RMSE, MAE, and MAPE; the comparison results are shown in Table 10.  
From Table 10, it can be seen that the performance of the CGO-MLSSVR prediction model proposed in this paper is higher than that of the traditional MLSSVR and GRNN prediction models in terms of RMSE, MAE, and MAPE. In terms of model analysis, the traditional MLSSVR model uses the grid search method to obtain hyperparameters, but it is affected by the search range and search step, which easily falls into the local optimum, thus reducing the MLSSVR training and prediction ability. The GRNN model itself has a certain error, and the sample data obtained from the welding test are small; this prevents large-scale learning, making the GRNN neural network prediction performance weaker. The CGO-MLSSVR prediction model has a better global search and prediction ability in small-scale sample data to compensate for the lack of large sample data in the grid search method and neural network, meaning that CGO-MLSSVR has the best prediction performance among the three models. Our results are comparable with the state-of-the-art literature. The literature [33] uses the powerful non-linear mapping capability of the Kriging algorithm to predict nugget diameters. The maximum relative error between the predicted and actual values of this model is about 8.7%, and the maximum relative error of the nugget diameter in this paper is 6.86%. The Bayes-XGBoost algorithm [34] was used to predict the resistance spot welds: the experiments showed that the nugget diameter MAE was 0.0151 and the tensile shear load RMSE was 1.835, slightly better than the method proposed in this paper.