# Metrics Related to Confusion Matrix as Tools for Conformity Assessment Decisions
## 3 Results and Discussion
### Metrics Analysis  
For basic tested metrics: accuracy, precision, recall and F1 score, the values of the metrics for the improved model are higher in comparison with the values of the metrics in the initial model, (Figure 7). In the initial model, the accuracy drops along the guard band axis (Figure 7a). For the producer's risk minimization model with the positive guard band values, the accuracy value drops as the guard band length increases, i.e., the number of rings classified in TP and TN category decreases. For models with negative guard band values, seen from zero to the left side of the graph, with an increase in the length of the guard band, the accuracy increases. That is, the number of rings classified into the TP and TN categories increases. For the improved model, the accuracy metric graph changes behavior in comparison with the initial model. The values of the accuracy metric increase along the guard band axis to the maximum value \(accuracy=0.9983486\), and then they fall (Figure 7b). The maximum value is reached when the total number of rings classified in the categories TP and TN is equal to 9984, for the length of the guard band \(w=-0.001\) mm. Since the guard band value is negative, this is a producer's minimization risk model. In that case, the multiplicative factor has a value \(r=-0.4\). Because of measurement uncertainty, there is no perfect classification in metrology, in the sense that all measured values are classified either in the \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Global Risk** & **w=\(-\)0.0025 mm** & \multicolumn{3}{c}{**w=0**} & \multicolumn{2}{c}{**w=0.0025 mm**} \\ \hline
**Model** & **Initial** & **Improved** & **Initial** & **Improved** & **Initial** & **Improved** \\ \hline \(R_{P}\) & 288 & 0 & 484 & 14 & 895 & 81 \\ \hline \(R_{C}\) & 380 & 21 & 233 & 6 & 122 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Reducing of the number of rings rejected as non-conforming although they meet specifications, and those accepted as conforming, but which do not meet specifications. Figure 7: Basic metrics curves: (**a**) Initial model; (**b**) Improved model. TP or TN category. One of the two values, FA or FR, is always non-zero. If both values were equal to zero at the same time, the absence of measurement uncertainty would be implied, which is not possible. Furthermore, in the conformity assessment process, because of classification in categories, imbalanced data are obtained. For a properly conducted measurement, and controlled manufacturing process, with few products rejected as non-conforming, TP is always much higher than TN. If the number of rings classified as TN is negligible in comparison with the number of rings in the TP category, the accuracy metric is insensitive to the TN category and measures the number of rings classified in the TP category. In that case, it is better to apply some other metric associated with confusion matrices as a measure of the tested model performance [37; 38; 39]. The classic choices are the precision and recall metrics. Due to the decrease in global consumer's risk, the precision curve increases along the guard band axis. According to the definition, precision measures the number of rings that are within the acceptance interval and that are classified in the TP category. In the model of the producer's risk minimization, this number decreases as the length of the guard band increases. In the consumer's risk minimization model, the number of such categorized rings increases with the increase in the length of the guard band. The reverse is true for the recall metric. Since the number of conformed rings classified in the TP category is decreasing, and the global producer's risk is increasing along the guard band axis, the recall curve falls. Individually by models, for the model of the minimization of global producer's risk, the recall curve grows while increasing the length of the guard band. In the model of minimizing the consumer's risk, recall falls.