# Quality Prediction and Parameter Optimisation of Resistance Spot Welding Using Machine Learning
## 4 Results and Discussion
### Weld Quality Prediction Based on the CGO-MLSSVR Model  
The 32 sets of experimental data in Table 3 were first randomly sorted; the first 26 sets of data were selected as training data, and the last 6 sets of data were used as test data. The parameters of the initialised CGO-MLSSVR prediction model are shown in Table 4. After several rounds of debugging and training, the CGO-MLSSVR prediction model with the optimal hyperparameters \(\theta\) = \(\{-\)8.6925, \(-\)10, \(-\)3.5112\(\}\) obtained higher accuracy prediction results. The CGO-MLSSVR training model was constructed with 26 sets of training data, where the relationships between welding voltage, welding time (WT(ms) =WT1 (ms) +WT2(ms)) and tensile shear load, and nugget diameter and tensile shear load, are shown in Figure 6, reflecting the variation of tensile shear load with welding process parameters (WV1, WV2, WT), and the correlation between tensile shear load and nugget diameter in weld quality. The dependence of the tensile shear load on the input welding voltage parameter is illustrated in Figure 6: the tensile shear load is nonlinear in terms of the welding voltage, characterised by the absence of a consistent flat region and large fluctuations in the tensile shear load value from 130 N to 260 N. In general, the tensile shear load increases with the increase in welding time under the condition of a certain welding voltage. The tensile shear load increases with increasing welding voltage under the condition of a certain welding time. However, the welding voltage in Figure 6a in [2100, 2300], with a welding time in the range of [5.5, 6.5], presents a trend of reduced weld tensile shear load. In Figure 6b, the welding voltage in [2300, 2400], with a welding time in the range of [4, 5], shows the welding tensile shear load to be significantly reduced. The reason for the reduction in weld \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Variable** & **Iteration Times** & **Eligible Points** & **Dimensional** & **Solution Space Range** \\ \hline Value & 100 & 30 & 3 & [\(-\)10, 10] \\ \hline \hline \end{tabular}
\end{table} 
Table 4: CGO initialisation value. Figure 6: Correlation of welding process parameters and nugget diameter with tensile shear load. (**a**) Relationship between WV1 and WT on TSL; (**b**) Relationship between WV2 and WT on TSL; (**c**) Relationship between PEND and NEND on TSL. tensile shear load is that the two stages of welding voltage and welding time in this range are not equal, and there is a polarity effect, resulting in two welding nugget diameters not of the same size; this, in turn, results in a smaller average nugget diameter and a reduction in tensile shear load. In terms of the correlation of welding quality, Figure 6c shows that the overall tensile shear load increases with increasing nugget diameter (PEND or NEND), as observed along the X-axis or Y-axis. The nugget diameter required for this study should have been consistent. Combining X-axis and Y-axis analysis, when the positive electrode and negative electrode nugget diameters are within [\(-0.1\), \(0.1\)] of each other, the tensile shear load initially increases with increasing nugget diameter, and after reaching a peak, the tensile shear load decreases with increasing nugget diameter, indicating a complex non-linear relationship between tensile shear load and nugget diameter. The nugget diameter increases but the tensile shear load decreases because, with the increase in welding voltage, excessive energy input to the nugget diameter increases, resulting in spatter, weld through, and other welding defects, so that the tensile shear strength decreases.