## 3 Machining Quality Prediction Method Based on XGBoost Hyperparameter Optimization
### Quality Prediction of Key Machining Characteristics of Marine Diesel Engine Piston  
Establishing a processing quality prediction model for key quality characteristics can evaluate the processing quality before machining and reduce the economic losses caused by substandard processing quality in production. Based on information entropy, the critical quality feature identified is the No. 43 quality feature in process 15 (milling the plane and fillet on both sides). The processing equipment used in process 15 is a T611C digital displayoring and milling machine, with its basic parameters shown in Table 4.  
To reduce processing times and economic costs and to obtain a training dataset uniformly distributed in the sample space, an orthogonal experiment with three factors and five levels is used. This results in 125 experimental schemes, from which five sets of non-training data are selected as verification datasets. Cutting speed (\(n\)), feed speed (f), and depth of cut (ap) significantly influence the machining process. [PERSON] et al. (2017) and [PERSON] et al. (2018) studied the relationship between these factors and machining error, while [PERSON] et al. (2018) analyzed the influence of interactions between processes on machining accuracy. Cutting speed is also an important factor affecting machining quality during the processing of parts, and it can be calculated using the following Formula (19):  
\[v=\frac{\pi\cdot n\cdot D}{1000} \tag{19}\]  
where \(v\) represents the cutting speed in m/min, \(n\) is the spindle speed in r/min, and \(D\) is the machining diameter of the boring tool in mm. Therefore, each data point in the dataset should include features such as spindle speed \(n\), feed rate \(f\), and depth of cut \(a_{p}\), as well as cutting speed \(v\) and factors from prior machining operations that influence the current machining process. In Section 4.1, the screening of key quality characteristics of marine medium-speed diesel engine pistons was completed. Based on Table 2 and the piston machining process card, we can abstract the machining process, features, and quality characteristics into vertices in a graph, with the relationships among processes, machining features, and quality features as edges between vertices ([PERSON] et al., 2017). Finally, the machining process network of the piston is illustrated in Figure 6. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Spindle Diameter** & **Spindle Motor Power** & **Machining Height** & **Table Load Capacity** \\ \hline
110 mm & 6.5–8 Kw & 1800 mm & 5 t \\ \hline
**Three-axis travel** & **Boring spindle speed** & **Table size** & **Facing head tool** \\  & **range** & **shape** & **holder machining** \\  & & & **diameter** \\ \hline
800 \(\times\) 1200 \(\times\) 1100 mm & 12–950 rpm & 1010 \(\times\) 1320 mm & 630 mm \\ \hline
**Forming Lathe Tool** & **Forming Lathe Tool** & - & - \\
**R16 (Left)** & **R16 (Right)** & & \\ \hline
16 mm & 16 mm & - & - \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Parameters of T611C digital display boring machine. As shown in Figure 5, both the preceding machining feature 10A and the machining feature 13A influence the machining feature 15A. The machining feature 10A serves as the positioning reference for the machining feature 15A, while the roughing process of the machining feature 15A affects the machining feature 13A. Consequently, the machining error \(\varepsilon_{1}\) and the roughing error \(\varepsilon_{2}\) of the positioning reference are the other two characteristics of each piece of data. The data are labeled with the machining quality of the critical quality feature, i.e., the actual machining dimension measurement. Since the XGBoost machine learning algorithm used in this paper is based on the decision tree algorithm, the dataset does not need normalization during preprocessing; it only requires anomaly detection. The box plot method is used to detect abnormal data in the training dataset.