## 4 Prediction Performance Analysis
When the spindle rate was 10,000 r/min, the maximum residuals of the LSTMNN model, CNN-LSTMNN model, CSOA-CNN-LSTMNN model, and POA-CNN-LSTMNN model were 5.254 um, 2.899 um, 1.766 um, and 1.801 um respectively. The minimum residuals were \(-\)9.047 um, \(-\)6.589 um, \(-\)5.117 um, and \(-\)2.462 um respectively. The absolute values of the residual fluctuations were 14.301 um, 9.488 um, 6.883 um, and 4.263 um respectively. The residual curve of the POA-CNN-LSTMNN model had the smallest fluctuation and was closest to the zero axis. To sum up, at different spindle speeds, the residual curve of the LSTMNN model fluctuated the most, followed by the CNN-LSTMNN model and CSOA-CNN-LSTMNN model, and the residual curve of the POA-CNN-LSTMNN model fluctuated the least, which fully shows that, among the four models, the POA-CNN-LSTMNN model stood out as the most superior. To further substantiate the effectiveness of the model for forecasting thermal errors proposed in this study, we employed four commonly used evaluation metrics. These metrics included the root mean square error function ( RMSE), the mean absolute error function ( MAE), the mean square error function ( MSE), and the coef cient of determination R-square(R\({}^{2}\)). The _RMSE_ provides an indication of the dispersion level among the samples, and in nonlinear fitting, a smaller _RMSE_ value indicates a better level of accuracy. The _MAE_ is highly interpretable and easy to understand, and a lower value indicates better prediction performance. The _R-Square_ indicates the level of data fitness, and the range of its values is generally (0, 1): the closer to 1, the better the model fits. For the _MSE_, as the value decreases, the model correctness increases. The formulas for the four evaluation functions are as follows, where \(\hat{y}_{i}\) is thermal error predicted value, \(y_{i}\) is thermal error actual value, \(\overline{y}_{i}\) is the average error value, and \(n\) represents the total count of thermal errors:  
\[RMSE=\sqrt{\frac{\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}}{n}}\quad i=1,2,\ldots,n \tag{26}\]  
\[MAE=\frac{1}{n}{\sum_{i=1}^{n}}{|(y_{i}-\hat{y}_{i})|}\quad i=1,2,\ldots,n \tag{27}\]  
\[R^{2}=1-\frac{\sum_{i=1}^{n}{|y_{i}-\hat{y}_{i}|}^{2}}{\sum_{i=1}^{n}{|y_{i}- \overline{y}_{i}|}^{2}} \tag{28}\]  
\[MSE=\frac{1}{n}{\sum_{i=1}^{n}}(y_{i}-\hat{y}_{i})^{2} \tag{29}\]  
Figure 25 displays the evaluation index values of each model across various speeds. When the spindle speed was 1000 r/min, the _RMSE_ values for the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN, and LSTMNN models were 0.3127, 0.5434, 0.6803, and 0.8952, respectively: the _MAE_ values were 0.2581, 0.4403, 0.5662, and 0.7331, respectively: the \(R^{2}\) values were 0.9931, 0.9791, 0.9672, and 0.9432, respectively: and the _MSE_ values were 0.0978, 0.2953, 0.4628, and 0.8014, respectively. When the spindle rate was 2500 r/min, the _RMSE_ values of the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 0.4079, 0.5941, 0.684, and 1.0052, respectively: the _MAE_ values were 0.3495, 0.4907, 0.5861, and 0.8512, respectively: and the \(R^{2}\) and _MSE_ values were 0.9925 and 0.1664, 0.9841 and 0.353, 0.979 and 0.4679, and 0.9544 and 1.0104, respectively. When the spindle rate was 4000 r/min, the _RMSE_ values of the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, and LSTMNN models were 0.6378, 0.7783, 1.0908, and 1.6581, respectively: the _MAE_ values were 0.5344, 0.6353, 0.9253, and 1.3835, respectively: the \(R^{2}\) values were 0.992, 0.988, 0.9765, and 0.9458, respectively: and the _MSE_ values were 0.4067, 0.6058, 1.1897, and 2.7491, respectively. When the spindle rate was 7000 r/min, the _RMSE_ values of the POA-CNN-LSTMNN, CSOA-CNN-LSTMNN, CNN-LSTMNN, and LSTMNN models were 0.7553, 1.1819, 1.3975, and 2.4868, respectively: the _MAE_ values were 0.6158, 0.9717, 1.1699, and 2.0364, respectively: the \(R^{2}\) values were 0.9947, 0.987, 0.9818, and 0.9424, respectively: and the _MSE_ values were 0.5704, 1.3969, 1.9529, and 6.184, respectively.