# On the Influence of Data Imbalance on Supervised Gaussian Mixture Models
## 3 Performance Measures for Imbalanced Data  
In this Section, we briefly review the main performance measures available in binary or two-class classification tasks with particular emphasis placed on the imbalanced data case. For a thorough review see [PERSON] et al. [7] (Chapter 3).  
Performance measures in classification problems with binary-class data are typically obtained from the so-called _confusion matrix_. This a two-way table derived from the cross-tabulation of the model's predictions and actual classes, as shown in Table 1, where the positive class is usually the class of interest.  
In the context of imbalanced binary data, the positive class commonly refers to the minority class. Traditional metrics, such as the accuracy, defined as the proportion of correct classifications, i.e., \(\text{Accuracy}=(\text{TP}+\text{TN})/(\text{TP}+\text{FP}+\text{FN}+\text{TN})\), tend to be misleading in such scenarios, as they are heavily influenced by the majority class while neglecting the minority class. Therefore, alternative measures have gained increased attention and general adoption.  
Two measures derived from the field of information retrieval and which are widely used in machine learning are:  
\[\text{Precision} =\frac{\text{TP}}{\text{TP}+\text{FP}^{*}}\] \[\text{Recall} =\frac{\text{TP}}{\text{TP}+\text{FN}}.\]  
Precision, also known as Positive Predictive Value (PPV), quantifies the proportion of true positive predictions out of all positive predictions made by the classifier. It provides insights into the accuracy of positive predictions, but does not take into account false negatives, which may be critical in certain contexts. _Recall_, often referred to as True Positive Rate (TPR), measures the proportion of true positive predictions out of all actual positives in the dataset. Recall is a relevant metric since it focuses on all actual positives, which is crucial in scenarios where false negatives have severe consequences.  
A summary of precision and recall can be obtained by computing their harmonic mean. When both metrics are weighted equally, the F1 score is derived. However, if more emphasis is placed on recall, the F2 score can be calculated as:  
\[\text{F2}=\frac{\text{Precision}\times\text{Recall}}{0.8\times\text{Precision }+0.2\times\text{Recall}}=\frac{5\times\text{Precision}\times\text{Recall}}{ 4\times\text{Precision}+\text{Recall}}\]  
\begin{table}
\begin{tabular}{l l l} \hline \hline  & \multicolumn{2}{c}{**Actual/Observed**} \\ \cline{2-3}  & **Negative** & **Positive** \\ \hline Predicted & & \\ \hline Negative & True Negative (TN) & False Negative (FN) \\ Positive & False Positive (FP) & True Positive (TP) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Confusion matrix for two-class data.  
Another pair of performance measures particularly relevant in medical diagnostics are the sensitivity and the specificity, defined as:  
\[\text{Sensitivity} =\frac{\text{TP}}{\text{TP}+\text{FN}},\] \[\text{Specificity} =\frac{\text{TN}}{\text{TN}+\text{FP}}.\]  
_Sensitivity_, also referred to as True Positive Rate (TPR), measures the ability of a classifier to correctly identify positive instances, while _Specificity_, also known as True Negative Rate (TNR), indicates the capacity of a classifier to correctly identify negative instances. Equivalently, False Positive Rate (FPR) and False Negative Rate (FNR) could be defined as \(\text{FPR}=\text{FP}/\left(\text{TN}+\text{FP}\right)\) and \(\text{FNR}=\text{FN}/\left(\text{TP}+\text{FN}\right)\). In fact, it is easy to see that \(\text{FPR}=1-\text{Specificity}\) and \(\text{FNR}=1-\text{Sensitivity}\). It must also be noted that Sensitivity is equivalent to the Recall measure discussed previously.  
Finally, _Balanced Accuracy_ calculates the average of sensitivity and specificity, i.e.,  
\[\text{Balanced Accuracy}=\frac{\text{Sensitivity}+\text{Specificity}}{2},\]  
thus providing a comprehensive view of the classifier's performance across both classes, and for this reason it is especially relevant in cases of class imbalance.