## 4 Results and Discussion
### Machine Learning Models  
In the machine learning (ML) process, three different classification models were developed and evaluated: Bagged Trees (BT), Neural Network (NN), and Support Vector Machine (SVM). These models were trained using significant process parameters (X1 to X9) identified in previous stages of the analysis as key to predicting the occurrence of defects labelled D1 to D6. The dataset employed in the present study comprised 565 data points obtained during the final quality control phase of the manufacturing process. These data points encompassed a range of defect types (such as cracks, scratches, surface irregularities, and dimensional inaccuracies) and critical process parameters (e.g., curing temperature, feed rate, tool wear, cooling speed, etc.). This scope permitted a meaningful evaluation of the machine learning models and was sufficient for training and validation purposes. To prevent overfitting, a five-fold cross-validation method was used, and an 80/20 split between the training and test set was used. This ensured that each model was tested on different subsets of the data, allowing full use of the dataset in the validation and training process. Each model was subjected to a detailed evaluation based on several key metrics. These included prediction speed, which measures how quickly the model can make a prediction using new data; training time, which indicates how long it takes to train the model; and \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & \(\mathbf{p}\)**-Value** & **Significance** & **Test Type** \\ \hline Temperature (X1) & 0.00 & Significant & Kruskal–Wallis \\ \hline Coolant Type (X2) & 0.00 & Significant & Chi-square \\ \hline Cooling Speed (X3) & 0.00 & Significant & Kruskal–Wallis \\ \hline Tool Wear (X5) & 0.04 & Significant & Chi-square \\ \hline Cutting Speed (X6) & 0.03 & Significant & Kruskal–Wallis \\ \hline Tool Wear (X7) & 0.03 & Significant & Chi-square \\ \hline Rotational Speed of the Grinding Wheel (X8) & 0.02 & Significant & Kruskal–Wallis \\ \hline Grinding Time (X9) & 0.01 & Significant & Kruskal–Wallis \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Results of statistical tests. accuracy, which measures how well the model classifies defect cases compared to actual outcomes. Furthermore, the error rate was analysed, which reflects the percentage of incorrect classifications made by the model. Table 2 provides a detailed comparison of the results for each of these metrics across all models, allowing an assessment of their effectiveness and practical applicability. By comparing these key parameters, it is possible to select the best model for defect prediction in terms of both prediction accuracy and time efficiency. A comparative analysis of the best tree classification models was performed. The performance of the Bagged Trees (BT), Neural Network (NN), and Support Vector Machine (SVM) models was evaluated in terms of key metrics, including the prediction speed, training time, hyperparameters, accuracy, and error rate. The Bagged Trees (BT) model is based on an ensemble (bagging) method comprising 30 decision trees, with a maximum of 564 splits in each tree. The principal benefit of this approach is the high degree of stability in the predictions, which is achieved through the aggregation of the results from multiple models. This resulted in an accuracy rate of 94.2%, which is a highly commendable result. However, the model exhibits notable limitations in terms of prediction speed, with a processing capacity of only 1400 observations per second, rendering it the slowest among the models under analysis. The training time was 21.02 s, which also puts it last in terms of time efficiency. The error rate of the BT model was 5.8%, which was marginally higher than that of the neural network, but nevertheless within an acceptable range. In several respects, the neural network (NN) model demonstrated the greatest efficiency.