General Performance Score for classification problems

Several performance metrics are currently available to evaluate the performance of Machine Learning (ML) models in classification problems. ML models are usually assessed using a single measure because it facilitates the comparison between several models. However, there is no silver bullet since each performance metric emphasizes a different aspect of the classification. Thus, the choice depends on the particular requirements and characteristics of the problem. An additional problem arises in multi-class classification problems, since most of the well-known metrics are only directly applicable to binary classification problems. In this paper, we propose the General Performance Score (GPS), a methodological approach to build performance metrics for binary and multi-class classification problems. The basic idea behind GPS is to combine a set of individual metrics, penalising low values in any of them. Thus, users can combine several performance metrics that are relevant in the particular problem based on their preferences obtaining a conservative combination. Different GPS-based performance metrics are compared with alternatives in classification problems using real and simulated datasets. The metrics built using the proposed method improve the stability and explainability of the usual performance metrics. Finally, the GPS brings benefits in both new research lines and practical usage, where performance metrics tailored for each particular problem are considered.


Introduction
Supervised Learning is the set of Machine Learning (ML) techniques that use labelled data. The task of these techniques is to learn a function that maps an input to a label, learning from examples of input-label pairs. When the label is categorical, the task addressed by these methods is referred to as classification. Based on the characteristics of the labels, several types of classification problems are defined: binary, multi-class, multi-labelled, and hierarchical [24].
In the literature, there are several metrics to evaluate the performance of ML models in classification problems [25]. Most of these metrics are defined for binary classification, of which some can be generalised for more than two classes. In practice, data analysts focus mainly on selecting the algorithm with the best predictive performance, disregarding the selection of the specific performance metric [6]. However, no general performance metric exists. Consequently, the proper definition of a performance metric, based on the problem domain and requirements, is crucial. Performance metrics are used to rank ML models and to evaluate if the selected one meets the classification requirements. Therefore, the choice of the right metric is crucial, especially when the cost of misclassification varies between classes.
In general, given a classification ML model, the information regarding its performance is summarised into a confusion matrix. This matrix is built by comparing the observed and predicted classes for a set of observations. It contains all the information needed to calculate most of the classification performance metrics. Among them, Accuracy (ACC) is one of the most common. It represents the ratio of correctly predicted observations. However, in many binary classification problems, alternative measures that combine two metrics regarding the classification task in both classes are more appropriate.
In this paper, several performance metrics used in classification problems are discussed. The General Performance Score (GPS), a new family of classification metrics, is presented. The GPS is obtained from the combination of several metrics estimated through a K × K confusion matrix, with K ≥ 2 . Therefore, this family of metrics performs for both binary and multi-class classification. Several instances of GPS are presented and compared with well-known alternative metrics from a theoretical and practical level.
The main contributions of the paper are listed as follows: -A novel family of performance metrics, GPS, is developed for both binary and multi-class classification. -GPS is configurable depending on the problem domain by combining appropriate performance metrics. -GPS performance metrics allow a high explainability of the performance of the ML models.
The rest of the paper is structured as follows. Section 2 presents an overview of binary and multi-class classification metrics based on the confusion matrix. The proposed metrics family is described in Section 3 for both binary and multi-class classification. Experiments on simulated and real case studies with different number of classes are detailed in Section 4. Finally, Section 5 concludes and provides further research lines.

Binary classification
In a binary classification problem, with classes −1 and +1 , the performance metrics achieved by the selected ML classifier are obtained from the well-known 2 × 2 confusion matrix (see Table 1). This matrix relates the observed values to the ones predicted by the classifier. Notice that many ML models return probabilities. In these cases, a threshold on these probabilities can be used to obtain binary predictions. The elements of a confusion matrix are: -True Positive (TP): the observed +1 instances that are predicted as +1. -True Negative (TN): the observed −1 instances that are predicted as −1. -False Positive (FP): the observed −1 instances but predicted as +1. -False Negative (FN): the observed +1 instances but predicted as −1.
FP and FN are also known as type I and type II errors, respectively. The relative importance of these errors depends on the problem under consideration [5,21]. For instance, in anomaly detection problems, the number of observed +1 is usually much smaller than the number of observed −1 . On the one hand, the FP are false alarms that should be treated by the system. This implies several actions with an associated cost. On the other hand, the FN are those anomalies that are not detected by the system and thus, could potentially damage it.
The performance metrics that can be obtained from a confusion matrix are summarised in Table 2. The most intuitive one is the ACC [9], which represents the ratio of correctly predicted instances among all instances in the dataset. The complementary metric is the Error Rate (ERR), which evaluates the model by its proportion of incorrect predictions. Both metrics are commonly used by researchers to select a model. However, these two metrics turn out to be an overoptimistic estimation of the ability of the classifier over the Table 1 Confusion matrix for binary classification

BA
Balanced Accuracy majority class [4]. Consequently, they are sensitive to imbalanced data.

Matthews Correlation Coefficient
The Precision, also known as Positive Predictive Value (PPV), can be considered as the probability of success when an instance is classified as +1 . The Sensitivity, also known as Recall or True Positive Rate (TPR), can be understood as the probability that an observed +1 is classified as +1 by the ML classifier. The Specificity, also known as True Negative Rate (TNR), is the proportion of −1 instances that are correctly predicted. Similarly, the Negative Predictive Value (NPV) is the proportion of −1 instances correctly classified by the ML classifier. The main drawback of these metrics is that they do not consider all the confusion matrix elements. For example, the Sensitivity only focuses on positive examples, while Specificity only focuses on the negative ones. The main goal of ML classifiers is to improve the Sensitivity, without losing the Specificity. However, there is a trade-off between these two metrics since increasing the Sensitivity implies a decrease in the Specificity and vice versa. The same relationship appears between Sensitivity and Precision. Besides, Precision and NPV are sensitive to imbalanced data. Each of these four metrics cannot be used separately to evaluate the performance of a ML method because none of them takes into consideration the entire confusion matrix. This is, they do not take into account all information that the classifier provides. Hence, these metrics are adequate for capturing a partial perspective of the classifier performance, but are individually insufficient.
Regarding the four basic metrics, given three of them, the remaining fourth can be obtained. For instance, given PPV, TPR, and TNR, the NPV is defined as follows: The Balanced Accuracy (BA) is the arithmetic mean of Sensitivity and Specificity. That is, the average of two rates: positive instances correctly classified and negative instances correctly classified. The BA, unlike Accuracy, is robust for evaluating classifiers over imbalanced datasets.
Another useful metric is the geometric mean of Sensitivity and Specificity, konwn as Geometric Mean (GM) [25]. It can be used both with balanced and imbalanced data. Likewise, Fowlkes-Mallows Index (FM) [12] is defined as the geometric mean of Sensitivity and Precision. In contrast to GM, FM will approach zero with a random classification.
Notice that the harmonic mean is more intuitive than the arithmetic mean when computing a mean of ratios. Thus, the F + 1 (usually called F 1 -score [23]) is defined as the harmonic mean of Precision and Recall. Therefore, to achieve a high F + 1 value, it is necessary to have both high values of Precision and Recall. Even though the F + 1 is popular in statistics, it can be misleading since it does not consider the TN. Thus, this performance metric does not consider the ratio of −1 instances correctly classified by the ML classifier. Besides, F + 1 is not invariant to class swapping. Furthermore, it is possible to define the F − 1 [22] as the harmonic mean of Specificity and NPV. The F − 1 is a tradeoff between the success of predicting an observation as −1 and the ratio of right predictions in the negative class. The F − 1 has the same strengths and weaknesses as the F + 1 , but focusing on the negative class. That is, it considers the TN but not the TP.
Markedness (MK) is defined as the distance of the sum of Precision and NPV to 1, while Bookmaker Informedness (BM) is defined as the distance between 1 and the sum of Specificity and Sensitivity [20]. Again, both measures complement each other, but do not provide an overall view of the different perspectives provided by the four metrics involved in their definitions. MK is sensitive to changes in data distributions and, hence, it is not appropriate for imbalanced data [25]. On the contrary, BM is suitable with imbalanced data. Nevertheless, it does not change concerning the differences between Specificity and Sensitivity [25].
In [22], a new metric that considers all the elements in the confusion matrix has been recently proposed. The Unified Performance Measure (UPM) is defined as the harmonic mean of F + 1 and F − 1 . Thus, UPM assess the performance on both the positive and the negative class. This performance metric has high values only when the four fundamental metrics, PPV, TPR, PNR, and NPV, also have high values. In addition, UPM is suitable with imbalanced data [22].
In the same way, Matthews Correlation Coefficient (MCC) [16] also includes all the elements of the confusion matrix. MCC is defined as the geometric mean of the regression coefficients of the problem and its dual. It can be also formulated as follows: However, MCC differs from the above-mentioned metrics as it takes values in the range [−1, 1] . On the one hand, MCC = 1 means that both classes are perfectly classified, as it occurs in the alternative metrics. On the other hand, MCC = −1 reveals a total disagreement between the observed and the predicted classes. MCC = 0 indicates a random prediction. It has been proven that MCC is not as stable as UPM [22]. The Cohen's Kappa coefficient measures the accordance between the ML classifier and the observed classes as follows: where Pr(e) is the hypothetical probability of agreement by chance, using the observed data to calculate the probabilities that each observer will randomly rank each category. The Cohen's Kappa coefficient also takes values from −1 to +1 . The Cohen's kappa coefficient is more informative than Accuracy when working with imbalanced data. However, it is likely to give low values for imbalanced data [2]. Finally, the Receiver Operating Characteristics (ROC) graph is a technique for visualising, organising, and selecting classifiers based on their performance [8]. In this case, a set of confusion matrices is obtained by modifying parameters in the model. ROC graphs are two-dimensional representations in which two inversely related variables are plotted. For instance, TPR is usually plotted versus False Positive Rate (FPR) ( FPR = 1 − TNR ). These two metrics are calculated for each confusion matrix. Then, the ROC curve is plotted with TPR against the FPR where TPR is on the y-axis and FPR is on the x-axis. The Area Under the ROC Curve (AUC) [3] is the performance metric obtained from ROC. It is defined as the proportion of the unit square under the ROC curve. Thus, it takes values in the range [0, 1]. No realistic classifier should have an AUC less than 0.50. Although the AUC is generally used, it presents some drawbacks. For instance, the AUC lacks clinical interpretability because it does not reflect when diagnostic tests are presented in terms of gains and losses to individual patients [13].

Multi-class classification
Consider a multi-class classification problem with K classes to be predicted by a ML classifier. As in the binary classification, most performance metrics are obtained from the confusion matrix (see Table 3). In this matrix, the element C ij ( i, j = 1, … , K ) represents the number of the elements in class j classified as class i.
A common approach when dealing with multi-class classification problems is the One vs Rest technique [1]. It consists on facing each of the classes against the rest of them. Thus, the model is trained and evaluated on a binary setting where one of the classes is set to positive and the others to negative. This process is repeated for all classes obtaining a binary confusion matrix for each class. An instance of this approach is the generalisation of F + 1 to multi-class classification, the Macro − F + 1 [19]: where F + 1,i is the F + 1 value obtained from the confusion matrix when the i-th class is faced against the rest of the classes. Analogously, Macro-Precision, Macro-Recall, Macro − F − 1 , and Macro-Accuracy can be defined. Notice that Macro − F + 1 is an arithmetic mean of harmonic means. An alternative to macro averages are micro averages. Since a FP for a given class is a FN for another class, all errors are considered the same in multi-class micro averages. The same reasoning applies to TP and TN. Thus, FP = FN and TP = TN . In this context, the Micro-Accuracy (or multiclass accuracy) is defined as the ratio between the correctly predicted instances and the dataset size. Furthermore, the Micro-Accuracy equals the Micro-Recall, the Micro-Precision, and the Micro-F 1 . When the dataset is imbalanced, Micro-Accuracy provides an overoptimistic estimation of the classifier performance over the majority class. Notice that these metrics are invariant to class swapping since TP = TN and FP = FN.
There are also specific approaches to extend binary metrics to a multi-class setting such as multi-class MCC [10] and multi-class Cohen's Kappa coefficient [11]. Considering the K × K confusion matrix in Table 3, MCC K for multiclass classification is defined as: The range of multi-class MCC is different from the binary MCC. In this case, the minimum value might be between −1 and 0 depending on the labels distribution, while the maximum value is the same.
Regarding the multi-class Cohen's Kappa coefficient, it is defined as follows: MCC and Cohen's Kappa are close in multi-class classification. The only difference between them is that the denominator is slightly lower in Cohen's Kappa coefficient, justifying slightly higher final scores.

General Performance Score
Several performance metrics to evaluate ML classifiers have been presented in the previous section. However, in some cases it is necessary to jointly consider a set of metrics that emphasise different aspects of the classifier. Thus, it is necessary to define an approach that combines a set of metrics into a single one. In this section, GPS, an approach to perform this combination, is presented. Definition 1 Let p 1 , ⋯ , p n be n different performance metrics that describe the output of a ML model for a classification task, then the General Performance Score (GPS) is defined as follows: Notice that the GPS is the harmonic mean of the set of different performance metrics p 1 , ⋯ , p n . The harmonic mean is a measure of central tendency, which is useful when averaging rates like those obtained from the confusion matrix.
It can be proven that the GPS is also equal to: The GPS has the following properties: Property 1 When the set of n performance metrics are defined in [0, 1], the GPS is maximum, i.e., equal to 1, ⟺ all the performance metrics are maximum, i.e., equal to 1.
Property 2 GPS is equal to 0, if at least one performance metric is equal to 0.
Notice that the harmonic mean minimises the impact of large values while maximizing the impact of small values. Therefore, high values of GPS denotes that all of the the involved metrics have high values. Furthermore, it is possible to calculate the GPS standard deviation based on the standard deviation of the harmonic mean [17].

Property 3 The standard deviation of GPS is:
It is clear that the standard deviation is minimum (and takes the zero value) when all the performance metrics ( p i ) are the same. To study the maximum value for sd(GPS), first consider the binary case. Property 4 Given two performance metrics, the standard deviation of GPS is maximum when one of the metrics is 1 and the other is 1 3 . In this case, GPS= 1 2 , and sd(GPS Proof Given two performance metrics p 1 and p 2 , the maximum distance between them is achieved when one metric is equal to 1 and the other is equal to 0. However, in that case, the sd(GPS) is not defined. To examine the maximum of the function, let x = 1∕p 1 and y = 1∕p 2 . Thus, x, y ≥ 1 . Without loss of generality, we assume that x ≥ y . Then, the GPS is: The partial derivatives of the previous expression are: Given that x ≥ y , we require that x = 3y . Thus, when y = 1 , the derivative is 0 at x = 3 . That is, p 1 = 1∕3 , and p 2 = 1 . In such a case, GPS = . Figure 1 shows the value for the sd(GPS) at x ∈ [1, 100] and y ∈ [1,10] . Figure 1 shows the value for the sd(GPS) for all the values of x in [1,100] at several values of y. It can be shown that the maximum is achieved for y = 1 , x = 3.
It is straightforward to show the following property.
Property 5 Given a set of n performance metrics p 1 , … , p n , the standard deviation of GPS is maximum when p i = 1 ∀i = 1, … , n − 1 , and p n = 1 n+1 . In such a case, GPS= 1 2 , and In order to maximise this expression, s needs to be as small as possible. Then x i maximise the difference to the mean value s/n for all i. To minimise s, x i = 1 , ∀i < n . Thus, s = x n + n − 1 . Now, the standard deviation is: The derivative of this expression is: The root of the derivative is x n = n + 1 . Through the second derivative it can be demonstrated that it is a maximum. Thus, the standard deviation of GPS is achieved for x i = 1 , ∀i < n , and x n = n + 1 . Therefore, GPS =

Binary classification
In binary classification, a well-known particular case of GPS is the F + 1 -score. It corresponds to GPS parameterised with the Precision (PPV) and Recall (TPR): On the other hand, the F − 1 -score is GPS parameterised with the Specificity (TNR) and Negative Predictive Value (NPV): The UPM [22] is another performance metric that belongs to the GPS family. The UPM is equals to GPS parameterised with Precision (PPV), Recall (TPR), Specificity (TNR) and Negative Predictive Value (NPV): Given that the combined harmonic mean of two sets of variables is equal to the harmonic mean of the harmonic means of the two sets [18], the previous expression can be easily simplified to: This instance of GPS overcomes one of the main shortcomings of the F + 1 and F − 1 , which is that they do not consider TP and TN, respectively. Thus, both metrics are misleading for imbalanced classes. Further, it performs properly for imbalanced classification problems, since it is built using information regarding the performance of a classifier on both classes. In addition, it improves the stability and explainability of the existing metrics [22].
Another possible instance of GPS is the combination of the Specificity (TNR) and Sensitivity (TPR): This same combination is performed by the GM and BA (see Section 2) that use the geometric and arithmetic mean, respectively. Since the harmonic mean is lower or equal than the geometric mean, and the geometric mean is lower or equal than the arithmetic mean, then:

Multi-class classification
In this section, several instances of GPS in a multi-class classification problem are discussed. Lets consider a multiclass confusion matrix with K-classes (see Table 3). Applying a technique for switching from multi-class confusion matrices to binary matrices, it is possible to obtain K different binary confusion matrices. For instance, in this case the One vs Rest technique is used. Let be UPM k (k in 1, … , K ) the calculated UPM for each of these K confusion matrices. Then, GPS can be parameterised with UPM k in order to create a multi-class performance metric as follows: Consider a uniform confusion matrix such that all the elements in the matrix are equal, the following property can be defined:

Property 6 Given a K-class classification problem. The value of GPS UPM for a uniform confusion matrix is:
Proof Let consider all the elements in the uniform confusion matrix equal to x. First, notice that all UPMs in a uniform confusion matrix are equal. Since GPS UPM is an harmonic mean of the UPMs, its value is equal to the value of the UPMs. Thus, it is enough to calculate one UPM. The UPM k in a uniform confusion matrix is equal to: The Precision and Recall are 1 K , and the NPV and Specificity are (K−1) 2 (K−1) 2 +(K−1) = K−1 K . Then, UPM is equal to: As an example, let us consider a 3-classes classification problem. The 3 × 3 multi-class confusion matrix can be divided into 3 binary confusion sub-matrices (see Table 4). Then, GPS(UPM 1 , UPM 2 , UPM 3 ) is defined as follows: Notice that in the particular case of ordered classes, the confusion matrix in Table 4b could be omitted. When the order is relevant, merging the first and last classes could be meaningless for the application domain perspective. Then, the GPS implementation parameterised with UPM for ordered classes is defined as follows: In such a case, GPS is defined as follows: Notice that when K = 2 , then GPS Recall is equal to the harmonic mean of Specificity and Sensitivity, presented in (18).

Experiments
In this section, several experiments on real and artificial datasets are considered. The properties and performance of GPS-based metrics are discussed and compared with alternative performance metrics. The first and second experiments consider a binary classification problem with simulated confusion matrices and real datasets, respectively. In the third experiment, a battery of simulated confusion matrices obtained from a multi-class classification problem is considered. Finally, in the fourth experiment, several definitions of GPS for two real dataset in multi-class classification problem are explored.

Simulated confusion matrices in binary classification
In this experiment, five confusion matrices are generated to compare GPS-based metrics against several alternatives. These confusion matrices are reported in Table 5. The confusion matrix a) presents a good classifier with adequate results in both classes. The confusion matrix b) is a random confusion matrix with the same values in all its cells. In the confusion matrices c) and d) only one class is correctly classified, negative class in c) and positive class in d). Finally, the confusion matrix e) presents a conservative classifier (most of the model predictions are negative) in an imbalanced dataset (most of the instances are positive). Table 6 shows the results of the metrics for these confusion matrices. In this experiment, the GPS(PPV, TPR, TNR, NPV) has been considered. First, when the classification model works properly, as in a), all Recall k metrics achieve high values. The GPS instance presents low values in the confusion matrices c), d) and e) since at least one of its performance metrics presents low values. Regarding the random confusion matrix b), the GPS value is 0.5. It is interesting to remark that in this case, all the performance metrics used in its definition have the same value. Thus, the standard deviation of GPS is 0.0. In confusion matrix e), the Precision and Specificity are very high, but the Recall and NPV are very low. In addition, it can be observed in the confusion matrices c) and d) that these metrics are sensitive to swapping the classes and to imbalanced data. The Balanced Accuracy obtains very similar values for the last four confusion matrices, although they represent totally different scenarios. It can be observed that the F + 1 and the F − 1 metrics are sensible to imbalanced data. In the confusion matrix c), F − achieves a high value while the positive class is almost entirely misclassified. On the other hand, in confusion matrix d), F + 1 achieves a high value while the negative class is almost entirely misclassified. Moreover, they are sensitive to swapping the classes. The Geometric Mean value in the confusion matrices c) and d) is similar to the random confusion matrix b). The Fowlkes-Mallows Index obtains very similar values to F + 1 .

Binary classification with real datasets
The performance of GPS for binary classification is also evaluated on several real datasets from the UCI Machine Learning Repository [7]. In this experiment, the following datasets are considered: -Pima Indians and Vote datasets: two imbalanced datasets for the positive class. Each dataset has been randomly split into two sets: training (80%) and testing (20%) sets. A Random Forest (RF) model with the following parameters has been trained on the training set: number of trees equals to 500, each tree grows to the maximum number of terminal nodes as possible, and the square root of the number of variables in the dataset is used as the number of variables randomly sampled as candidates at each split. Then, the metrics MCC and GPS are estimated over the testing sets. This process is repeated 100 times. Finally, the global performance metric values are obtained as the mean of the 100 performance score in the testing sets. The Mean, Standard Deivation (SD) and Coefficient of Variation (CV) for both GPS and MCC are shown in Table 7.
The correlation between both metrics is very high (Pearson correlation coefficient equals 0.98). However, GPS presents a lower standard deviation, which indicates that GPS is more stable. Furthermore, MCC obtains higher CV values, meaning that it is more dispersed than GPS. In addition, the GPS is easier to interpret since it is defined in the range [0, 1] as most performance metrics. Thus, it can be concluded that the proposed ML model performs properly for Vote and Ionosphere datasets. Better classifiers could probably be found for Sonar, Adult, and Pima Indians datasets. Finally, given the low values for GPS, the proposed classification technique shows a poor performance for Credit and Hepatitis datasets.

Simulated confusion matrices in multi-class classification
In this experiment, different simulated 3 × 3 confusion matrices are generated and presented in Table 8. The confusion matrices a) and b), show good classifiers on balanced datasets. The confusion matrices c) and d) correspond to very high imbalanced data. The confusion matrices e) and f) correspond to classifiers on imbalanced data. In the confusion matrix g) results from a bad classifier are presented. Finally, the confusion matrices h) and i) show very bad classifiers, completely wrong in their predictions. The following metrics have been calculated: Accuracy, Macro-Accuracy, Macro- Table 9 shows the results of the metrics for these multiclass confusion matrices. First, when the classes are balanced and the classification error is not high, as in a) and b), all performance metrics achieve higher values. Notice that the metrics Accuracy, Micro-F + 1 and Micro-F − 1 have the same results for all the proposed confusion matrices. In the confusion matrices c) and d), corresponding to imbalanced data, ACC and Macro-Accuracy are unreliable measures for model performance. The good performance of the model for the majority class implies high ACC and Macro-Accuracy, even when the performance of the model is low for The GPS UPM obtains the lowest possible value when all observations are wrongly classified. The GPS UPM is similar in the confusion matrices a) and c). Nevertheless, its standard deviation is minimum in a) 0.0, but 0.15 in c). This evinces a non-homogeneous performance along the different classes in the problem. The same occurs in cases b) (standard deviation 0.0) and e) (standard deviation 0.07). Note that following Property 5, the maximum standard deviation is 0.31. The GPS UPM value for confusion matrix g) implies a near-random performance. In fact, notice that the expected random value in each element of the diagonal is equal to the observed value 50 (450 observations to be distributed in 9 cells). Following Property 6, the GPS UPM for a uniform 3 × 3 confusion matrix is 4/9.
The confusion matrices h) and i) show non-zero values for Macro-F − 1 , even though all the observations are misclassified. In these two confusion matrices, MCC obtains different values. Moreover, negative MCC values are difficult to interpret. This difficulty arises from the fact that the minimum MCC value depends on the distribution of the observed label. Finally, Cohen's Kappa coefficient achieves similar results to MCC in all the cases except for the example i).
In that case, Cohen's Kappa coefficient performs similar to GPS providing the same values for h) and i).

Multi-class classification with real datasets
In the last experiment, GPS-based metrics are evaluated on multi-class datasets. Firstly, the three classes Connect-4 dataset [7] is used. Secondly, the four classes Vehicle dataset [7] is considered. Both datasets have been divided in training set (80%) to fit a ML model and testing set (20%).
In the Connect-4 dataset, a RF model with the following parameters has been trained on the training set: number of trees equals to 500, each tree grows to the maximum number of terminal nodes as possible, and the square root of the number of variables in the dataset is used as the number of variables randomly sampled as candidates at each split. For each observation in the testing set, the ML model returns the probability of belonging to each class. Given these probabilities, different thresholds are used to classify the elements. Thus, a set of confusion matrices is obtained.
Three GPS-based instances are considered to show that it can be built up depending on the particular problem specifications. First, the GPS UPM as a summary metric is calculated. Next, the GPS Recall is considered as a metric that focuses on the relevant instances retrieved from all the relevant instances of all the classes in the problem. Finally, the GPS Recall,Precision 3 is considered. In this case, it is calculated from the three Recalls and the Precision of class 3. In Table 10, the confusion matrices that maximise the GPS UPM , the GPS Recall and the GPS Recall,Precision 3 values respectively in the test dataset are presented. Table 11 shows the value of the metrics for each of confusion matrix. Notice that, in this case: The GPS UPM achieves its maximum value, 0.69 ± 0.08 , in the confusion matrix a). The standard deviation of GPS has been calculated using Property 3 in Section 3. Notice that the range of the six basic metrics (three Precisions and three Recalls) is minimal for this case: a) 0.56, b) 0.64, c) 0.75. When only the Recalls are relevant, the maximum of GPS Recall is 0.67 ± 0.07 , corresponding to confusion matrix b). Since the Precisions are not considered, they can have more extreme values (range equals 0.64), while less extreme values are allowed for the Recalls (range equals 0.21). Finally, when the GPS Recall,Precision 3 is used, a higher value of Precision 3 is obtained. In this case, the maximum value is achieved in confusion matrix c), ( 0.72 ± 0.08 ).
Secondly, GPS-based metrics are evaluated on the Vehicle dataset. In this case, the ML model selected is a Support Vector Machines (SVM) with linear kernel and cost equals to 1. For each observation in the testing set, the ML model returns the probability of belonging to each class. Given these probabilities, different thresholds are used to classify the elements. Thus, a set of confusion matrices is obtained.
In this case, six different GPS-based instances are considered to show that the classifier predictions that maximise the chosen performance metric will differ, depending on the GPS definition, leading to different confusion matrices.
First, the GPS UPM as a summary metric is calculated. Next, the GPS NPV is considered as a metric that measures the proportion of negative samples that were correctly classified respect to the total number of negative predicted samples. Later, the GPS Precision is considered as the inverse NPV, which represents the proportion of positive samples that were correctly classified with respect the total number of positive predicted samples. After, the GPS NPV,Precision 1 is considered. In this case, it is calculated from the four NPVs and the Precision of class 1. Then, the GPS Recall is considered as a metric that focuses on the relevant instances retrieved from all relevant instances of all classes of the problem. Finally, the GPS Recall,Precision 4 is presented to show the changes related to the increase in the Precision of class 4. In Table 12, the confusion matrices in the test dataset, obtained from the maximization of the different GPS-based instances are presented. GPS Recall , and the GPS Recall,Precision 4 values respectively in the test dataset are presented. Table 13 shows the values of the metrics for each confusion matrix.
The confusion matrix a) maximises GPS UPM , being the maximum value 0.12 ± 0.04 . The standard deviation of GPS

Conclusions
In this paper, the GPS, a novel family of performance metrics for binary and multi-class classification problems, has been presented. It is defined as the combination of a set of performance metrics using the harmonic mean. The harmonic mean is a natural choice to combine values representing ratios, such as those from the confusion matrix. Besides, it generates conservative combinations since it penalises low values. Thus, data analysts can develop different metrics tailored for the problem domain and the domain-expert goals based on GPS. Several instances of GPS have been presented and compared with various state-of-the-art performance metrics in both binary and multi-class classification problems. It has been shown that it is possible to use different instances of GPS depending on the particular problem specifications. These definitions lead to different class predictions from the classifier. Therefore, to different confusion matrices. The GPS has proven to be more stable and explainable than the alternatives. Further, it has been shown that previous definitions of performance metrics such as F + 1 , F − 1 and UPM are instances of GPS. Future work will focus on performing model selection using GPS. Given a set of ML classifiers, different performance metrics might lead to a different selection of best model. In this context, the effect of GPS-based metrics in the selection process could be evaluated. In addition, a sensitivity analysis to study the effect of different misclassification costs and different techniques to build binary matrices in multi-class problems will be carried out in the future. Further analysis will be carried out on the classification of datasets with a large number of categories. Notice that as the number of categories grows, the number of possible definitions of performance metrics that can be derived from the one proposed in this paper increases. Thus, a future research line would be to carry out a comparative study of the different solutions achieved through the chosen metrics within a specific problem. Furthermore, instances of GPS for multilabelled, hierarchical, and non-square confusion matrices classification will be developed. The latter corresponds to binary classification problems where an output with more than two options is more informative. For instance, in a system that predicts if a patient will die in a given surgery, an output such as high-risk, medium-risk, and low-risk is more informative than a binary output. Finally, future work will focus on the use of the method when the data are in tensor form [14,15].