## 2 Materials and Methods
### Data Analysis and Pipeline Creation  
An excerpt of the code developed specifically for this task can be found in Appendix A. To begin the analysis, the NUAA dataset was loaded. Then, it was cleaned and reorganized by removing irrelevant columns and rearranging the remaining ones. With the data prepared, an initial exploration was conducted to understand the structure of the dataset. Figure 1 offers descriptive statistics that are reviewed to gain a better understandingof the data characteristics, Figure 2a,b remain as support images to help illustrate a generic milling operation diagram to clarify milling parameters [17; 18; 19], and Figure 2c illustrates the different types of tool wear, out of which flank wear is the focus of this article. It can be seen (Figure 3) that out of the dataset, 149 rows are missing (null) values for bending moment x, bending moment y, and torsion, which could introduce errors during model training. To address this, we applied normalization to these rows instead of removing them. To gain a deeper understanding of the data, histograms were generated from the initial data exploration of the dataset, illustrating the distribution of the different characteristics. These graphs helped identify patterns and anomalies in the data (Figure 4). In the \(Y\)-axis, the total count of data is plotted, whereas the X-axis shows the data range of each variable in its respective units. Figure 1: Initial data exploration of the NUAA dataset. Figure 2: General milling operation sketches. (**a**) depicts a bending moment in one axis, (**b**) depicts general milling operation parameters, and (**c**) illustrates where flank wear occurs. From the data distribution graphs, it can be observed that most values have a wide data range, except for the topmost three graphs, which have three columns, indicating that the owners of the dataset employed three constant values to obtain the others. Furthermore, while the \(Y\)-axis maintains consistent units across the graphs, the \(X\)-axis varies significantly. For example, in the feed per tooth graph, the values range from 0.04 to 0.06, whereas in the axial force graph, the range spans from \(-1000\) to \(1000\). This disparity highlights the need for data normalization to ensure that the models can process the data effectively. It must be pointed out that those parameters can be negative, e.g., axial force can be physically negative because it represents a directional force along an axis. A negative axial force, such as \(-1000\), indicates compression rather than tension, reflecting the direction in which the force is applied: positive forces align with the axis, while negative forces act in the opposite direction. In practical terms, a positive axial force pulls or stretches a structure, while a negative axial force pushes or compresses it. To properly predict tool wear, a well-structured pipeline was leveraged to predict tool wear, employing a systematic approach to data preprocessing, model design, and validation. Figure 4: Graphical display of the data distribution from the NUAA dataset. Figure 3: Missing values in each column. The process involved multiple steps, each critical to ensuring the models' accuracy and robustness. The steps can be summarized as follows:  
1. Data Preparation and Preprocessing. First, the dataset was processed to handle any potential inconsistencies. Any non-numeric values in the dataset were coerced into a numerical format, and any rows containing missing values were removed to ensure that the models only trained on clean and complete data, reducing the risk of errors during training. Next, the dataset was split into features and the target variable. The features, which were various characteristics of the cutting tools, formed the input to the models, while the target variable was the tool wear, which the models were supposed to predict.