# Risk Assessment for Linear Regression Models in Metrology
## 3 Results and Discussion
### Comparison of Models Using Metrics Related to the Confusion Matrix  
Recent studies have shown that risk assessment models can be compared using metrics relates to the confusion matrix [18; 34]. Expressions for evaluating the global risk of producers and consumers from equations (28) and (31) are a kind of classifier that sorts measurements as falsely rejected (FR) and falsely accepted (FA), so that \(\mathrm{R_{P}}=\mathrm{FR}\) and \(\mathrm{R_{C}}=\mathrm{FA}\). Considering that the measurements within the tolerance interval and the acceptance interval were defined as true positive (TP), and that the measurements outside the acceptance interval and tolerance interval were defined as true negative (TN), it is feasible to construct a confusion matrix [18]. For the confusion matrix constructed this way, especially, it is true that \(\mathrm{TP}+\mathrm{TN}+\mathrm{FR}+\mathrm{FA}\)=1. In addition, it holds that  
\begin{table}
\begin{tabular}{c c c c c} \hline \multicolumn{5}{c}{**RMSE, Global Consumer’s Risk**} \\ \hline
**Measurement \(\mathbf{y_{i}/\mu}\)** & \(\mathbf{R_{C}}\_\mathbf{M_{1}/\%}\) & \(\mathbf{R_{C}}\_\mathbf{M_{2}/\%}\) & \(\mathbf{R_{C}}\_\mathbf{M_{3}/\%}\) & \(\mathbf{R_{C}}\_\mathbf{M_{4}/\%}\) \\ \hline
**y\({}_{1}\)** & 0.63 & 0.94 & 5.40 & 5.27 \\
**y\({}_{2}\)** & 0.22 & 0.35 & 2.55 & 2.68 \\
**y\({}_{3}\)** & 0.17 & 0.27 & 2.11 & 2.16 \\ \(total\_\mathrm{R_{C}}\) & 0.40 & 0.60 & 3.66 & 3.63 \\ \hline \multicolumn{5}{c}{**RMSE, Global Producer’s Risk**} \\ \hline
**Measurement \(\mathbf{y_{i}/\mu}\)** & \(\mathbf{R_{P}}\_\mathbf{M_{1}/\%}\) & \(\mathbf{R_{P}}\_\mathbf{M_{2}/\%}\) & \(\mathbf{R_{P}}\_\mathbf{M_{3}/\%}\) & \(\mathbf{R_{P}}\_\mathbf{M_{4}/\%}\) \\ \hline
**y\({}_{1}\)** & 1.16 & 0.97 & 2.40 & 2.52 \\
**y\({}_{2}\)** & 0.46 & 0.4 and that \(\rm TN=1-P_{C}-R_{C}\)[18]. For a well-performed measurement, it is always the case that \(\rm TP\gg TN\), i.e., it is about imbalanced data [65]. Since, in the measurements there is always a measurement uncertainty, in practice, it is assumed that the risks \(\rm R_{P}\) and \(\rm R_{C}\) are always present and that their values differ from zero. Theoretically, in metrology, these values can be equal to zero, but not simultaneously. The models outlined in the article can be evaluated by utilizing any of the commonly recognized metrics: accuracy, precision, recall, F1 score, [PERSON]'s correlation coefficient (MCC), Cohen's Kappa, etc. [66; 67]. A comparison of models by using metrics associated with confusion matrices was conducted for the area enclosed by the moderate scale and guard band axes. In this article, the F1 score, and diagnostic odds ratio (DOR) were chosen for model comparison. The F1 score is the harmonic mean of precision and recall. According to [18], in the metrological sense, it can be written in the form:  
\[\rm F1=\frac{P_{C}-R_{P}}{P_{C}-R_{P}+\frac{R_{P}+R_{C}}{2}}. \tag{38}\]  
This metric is conveniently used in binary classification when it is necessary to recognize and classify a specific class of confusion matrix [68]. Here, it is the TP class. Standard values of the F1 score range from \([0,\,1]\). In the metrological sense, the values \(0\) and \(1\) should be excluded. If the value of the F1 score were to be zero, it would be true that \(\rm R_{P}=P_{C}\), thereby indicating there is no TP measurement. Also, if the value of the F1 score were to be one, it would mean that \(\rm R_{C}+R_{P}=0\), which is impossible because of measurement uncertainty. This is the rationale behind why the values of the F1 score, in the realm of metrology, ought to be within the interval \(\langle 0,1\rangle\). The model's performances are better for values of the F1 score that are closer to one. Furthermore, the curves of the F1 score along the guard band axis pass through the intersection of the precision and recall curves. That characteristic intersection point is obtained for that value of the guard band for which \(\rm R_{C}=R_{P}\)[18].