Computer ScienceJan 2020Cited by 18 papers on PaperVantageClassic Paper

Manuscript Offprint

Computer Science

The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation

Davide Chicco, Giuseppe Jurman

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Background: To evaluate binary classifications and their confusion matrices, scientific researchers can employ several statistical rates, accordingly to the goal of the experiment they are investigating. Despite being a crucial issue in machine learning, no widespread consensus has been reached on a unified elective chosen measure yet. Accuracy and F1F_{1} score computed on confusion matrices have been (and still are) among the most popular adopted metrics in binary classification tasks. However, these statistical measures can dangerously show overoptimistic inflated results, especially on imbalanced datasets.

Results: The Matthews correlation coefficient (MCC), instead, is a more reliable statistical rate which produces a high score only if the prediction obtained good results in all of the four confusion matrix categories (true positives, false negatives, true negatives, and false positives), proportionally both to the size of positive elements and the size of negative elements in the dataset.

Conclusions: In this article, we show how MCC produces a more informative and truthful score in evaluating binary classifications than accuracy and F1F_{1} score, by first explaining the mathematical properties, and then the asset of MCC in six synthetic use cases and in a real genomics scenario. We believe that the Matthews correlation coefficient should be preferred to accuracy and F1F_{1} score in evaluating binary classification tasks by all scientific communities.

Keywords: Matthews correlation coefficient, Binary classification, F1F_{1} score, Confusion matrices, Machine learning, Biostatistics, Accuracy, Dataset imbalance, Genomics

Background

Given a clinical feature dataset of patients with cancer traits [1, 2], which patients will develop the tumor, and which will not? Considering the gene expression of neuroblastoma patients [3], can we identify which patients are going to survive, and which will not? Evaluating the metagenomic profiles of patients [4], is it possible to discriminate different phenotypes of a complex disease? Answering these questions is the aim of machine learning and computational statistics, nowadays pervasive in analysis of biological and health care datasets, and

many other scientific fields. In particular, these binary classification tasks can be efficiently addressed by supervised machine learning techniques, such as artificial neural networks [5], k-nearest neighbors [6], support vector machines [7], random forest [8], gradient boosting [9], or other methods. Here the word binary means that the data element statuses and prediction outcomes (class labels) can be twofold: in the example of patients, it can mean healthy/sick, or low/high grade tumor. Usually scientists indicate the two classes as the negative and the positive class. The term classification means that the goal of the process is to attribute the correct label to each data instance (sample); the process itself is known as the classifier, or classification algorithm.

∗^{*}Correspondence: davidechicco@davidechicco.it

1^{1}Krembil Research Institute, Toronto, Ontario, Canada

2^{2}Peter Munk Cardiac Centre, Toronto, Ontario, Canada

Full list of author information is available at the end of the article

Figure

© The Author(s). 2019 Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The Creative Commons Public Domain Dedication waiver (http://creativecommons.org/publicdomain/zero/1.0/) applies to the data made available in this article, unless otherwise stated.

Page 2 of 13

Scientists have used binary classification to address several questions in genomics in the past, too. Typical cases include the application of machine learning methods to microarray gene expressions [10] or to single-nucleotide polymorphisms (SNPs) [11] to classify particular conditions of patients. Binary classification can also be used to infer knowledge about biology: for example, computational intelligence applications to ChIP-seq can predict transcription factors [12], applications to epigenomics data can predict enhancer-promoter interactions [13], and applications to microRNA can predict genomic inverted repeats (pseudo-hairpins) [14].

A crucial issue naturally arises, concerning the outcome of a classification process: how to evaluate the classifier performance? A relevant corpus of published works has stemmed until today throughout the last decades for possible alternative answers to this inquiry, by either proposing a novel measure or comparing a subset of existing ones on a suite of benchmark tasks to highlight pros and cons [15–28], also providing off-the-shelf software packages [29, 30]. Despite the amount of literature dealing with this problem, this question is still an open issue. However, there are several consolidated and well known facts driving the choice of evaluating measures in the current practice.

Accuracy, MCC, F1F_1 score. Many researchers think the most reasonable performance metric is the ratio between the number of correctly classified samples and the overall number of samples (for example, [31]). This measure is called accuracy and, by definition, it also works when labels are more than two (multiclass case). However, when the dataset is unbalanced (the number of samples in one class is much larger than the number of samples in the other classes), accuracy cannot be considered a reliable measure anymore, because it provides an overoptimistic estimation of the classifier ability on the majority class [32–35].

An effective solution overcoming the class imbalance issue comes from the Matthews correlation coefficient (MCC), a special case of the ϕ\phi phi coefficient [36].

Stemming from the definition of the phi coefficient, a number of metrics have been defined and mainly used for purposes other than classification, for instance as association measures between (discrete) variables, with the Cramér's VV (or Cramér's ϕ\phi) being one of the most common rates [37].

Originally developed by Matthews in 1975 for comparison of chemical structures [38], MCC was re-proposed by Baldi and colleagues [39] in 2000 as a standard performance metric for machine learning with a natural extension to the multiclass case [40]. MCC soon started imposing as a successful indicator: for instance, the Food and Drug Administration (FDA) agency of the USA employed the MCC as the main evaluation

measure in the MicroArray II / Sequencing Quality Control (MAQC/SEQC) projects [41, 42]. The effectiveness of MCC has been shown in other scientific fields as well [43, 44].

Although being widely acknowledged as a reliable metric, there are situations - albeit extreme - where either MCC cannot be defined or it displays large fluctuations [45], due to imbalanced outcomes in the classification. Even if mathematical workarounds and Bayes-based improvements [46] are available for these cases, they have not been adopted widely yet.

Shifting context from machine learning to information retrieval, and thus interpreting positive and negative class as relevant and irrelevant samples respectively, the recall (that is the accuracy on the positive class) can be seen as the fraction of relevant samples that are correctly retrieved. Then its dual metric, the precision, can be defined as the fraction of retrieved documents that are relevant. In the learning setup, the pair precision/recall provides useful insights on the classifier's behaviour [47], and can be more informative than the pair specificity/sensitivity [48]. Meaningfully combining precision and recall generates alternative performance evaluation measures. In particular, their harmonic mean has been originally introduced in statistical ecology by Dice [49] and Sørensen [50] independently in 1948, then rediscovered in the 1970s in information theory by van Rijsbergen [51, 52] and finally adopting the current notation of F1F_1 measure in 1992 [53]. In the 1990s, in fact, F1F_1 gained popularity in the machine learning community, to the point that it was also re-introduced later in the literature as a novel measure [54].

Nowadays, the F1F_1 measure is widely used in most application areas of machine learning, not only in the binary scenario, but also in multiclass cases. In multiclass cases, researchers can employ the F1F_1 micro/macro averaging procedure [55–60], which can be even targeted for ad-hoc optimization [61].

The distinctive features of F1F_1 score have been discussed in the literature [62–64]. Two main properties characterize F1F_1 from MCC. First, F1F_1 varies for class swapping, while MCC is invariant if the positive class is renamed negative and vice versa. This issue can be overcome by extending the macro/micro averaging procedure to the binary case itself [17], by defining the F1F_1 score both on the positive and negative classes and then average the two values (macro), and using the average sensitivity and average precision values (micro). The micro/macro averaged F1F_1 is invariant for class swapping and its behaviour is more similar to MCC. However, this procedure is biased [65], and it is still far from being accepted as a standard practice by the community. Second, F1F_1 score is independent from the number of samples correctly classified as negative. Recently, several scientists highlighted drawbacks of the

Page 3 of 13

F1F_1 measure [66, 67]: in fact, Hand and Peter [68] claim that alternative measures should be used instead, due to its major conceptual flaws. Despite the criticism, F1F_1 remains one of the most widespread metrics among researchers. For example, when Whalen and colleagues released TargetFinder, a tool to predict enhancer-promoters interactions in genomics, they showed its results measured only by F1F_1 score [13], making it impossible to detect the actual true positive rate and true negative rate of their tests [69].

Alternative metrics. The current most popular and widespread metrics include Cohen's kappa [70–72]: originally developed to test inter-rater reliability, in the last decades Cohen's kappa entered the machine learning community for comparing classifiers' performances. Despite its popularity, in the learning context there are a number of issues causing the kappa measure to produce unreliable results (for instance, its high sensitivity to the distribution of the marginal totals [73–75]), stimulating research for more reliable alternatives [76]. Due to these issues, we chose not to include Cohen's kappa in the present comparison study.

In the 2010s, several alternative novel measures have been proposed, either to tackle a particular issue such as imbalance [34, 77], or with a broader purpose. Among them, we mention the confusion entropy [78, 79], a statistical score comparable with MCC [80], and the K measure [81], a theoretically grounded measure that relies on a strong axiomatic base.

In the same period, Powers proposed informedness and markedness to evaluate binary classification confusion matrices [22]. Powers defines informedness as true positive rate – true negative rate, to express how the predictor is informed in relation to the opposite condition [22]. And Powers defines markedness as precision – negative predictive value, meaning the probability that the predictor correctly marks a specific condition [22].

Other previously introduced rates for confusion matrix evaluations are macro average arithmetic (MAvA) [18], geometric mean (Gmean or G-mean) [82], and balanced accuracy [83], which all represent classwise weighted accuracy rates.

Notwithstanding their effectiveness, all the aforementioned measures have not yet achieved such a diffusion level in the literature to be considered solid alternatives to MCC and F1F_1 score. Regarding MCC and F1F_1, in fact, Dubey and Tatar [84] state that these two measure "provide more realistic estimates of real-world model performance".

However, there are many instances where MCC and F1F_1 score disagree, making it difficult for researchers to draw correct deductions on the behaviour of the investigated classifier.

MCC, F1F_1 score, and accuracy can be computed when a specific statistical threshold τ\tau for the confusion matrix is set. When the confusion matrix threshold is not unique,

researchers can instead take advantage of classwise rates: true positive rate (or sensitivity, or recall) and true negative rate (or specificity), for example, computed for all the possible confusion matrix thresholds. Different combinations of these two metrics give rise to alternative measures: among them, the area under the receiver operating characteristic curve (AUROC or ROC AUC) [85–91] plays a major role, being a popular performance measure when a singular threshold for the confusion matrix is unavailable. However, ROC AUC presents several flaws [92], and it is sensitive to class imbalance [93]. Hand and colleagues proposed improvements to address these issues [94], that were partially rebutted by Ferri and colleagues [95] some years later.

Similar to ROC curve, the precision-recall (PR) curve can be used to test all the possible positive predictive values and sensitivities obtained through a binary classification [96]. Even if less common than the ROC curve, several scientists consider the PR curve more informative than the ROC curve, especially on imbalanced biological and medical datasets [48, 97, 98].

If no confusion matrix threshold is applicable, we suggest the readers to evaluate their binary evaluations by checking both the PR AUC and the ROC AUC, focusing on the former [48, 97]. If a confusion matrix threshold is at disposal, instead, we recommend the usage of the Matthews correlation coefficient over F1F_1 score, and accuracy.

In this manuscript, we outline the advantages of the Matthews correlation coefficient by first describing its mathematical foundations and its competitors accuracy and F1F_1 score ("Notation and mathematical foundations" section), and by exploring their relationships afterwards (Relationships between rates). We decided to focus on accuracy and F1F_1 score because they are the most common metrics used for binary classification in machine learning. We then show some examples to illustrate why the MCC is more robust and reliable than F1F_1 score, on six synthetic scenarios ("Use cases" section) and a real genomics application ("Genomics scenario: colon cancer gene expression" section). Finally, we conclude the manuscript with some take-home messages ("Conclusions" section).

References (100)

  • Computational prediction of diagnosis and feature selection on mesothelioma patient health records
  • Supervised deep learning embeddings for the prediction of cervical cancer diagnosis
  • Distillation of the clinical algorithm improves prognosis by multi-task deep learning in high-risk neuroblastoma
  • Phylogenetic convolutional neural networks in metagenomics
  • Deep learning
  • K-nearest neighbor
  • Support vector machines
  • Random forests
  • XGBoost: a scalable tree boosting system (opens the publisher in a new tab)
  • Classification algorithms for phenotype prediction in genomics and proteomics
  • Predictor correlation impacts machine learning algorithms: implications for genomic studies
  • Virtual ChIP-seq: predicting transcription factor binding by learning from the transcriptome
  • Enhancer-promoter interactions are encoded by complex genomic signatures on looping chromatin
  • De novo SVM classification of precursor microRNAs from genomic pseudo hairpins using global and intrinsic folding measures
  • Statistical comparisons of classifiers over multiple data sets
  • A systematic analysis of performance measures for classification tasks
  • An experimental comparison of performance measures for classification
  • Theoretical analysis of a performance measure for imbalanced data (opens the publisher in a new tab)
  • A survey of binary similarity and distance measures
  • Evaluating Learning Algorithms: A Classification Perspective
  • Evaluation: from precision, recall and F-measure to ROC, informedness, markedness & correlation
  • How to evaluate performance of prediction methods?
  • Comparison of the performance evaluations in classification
  • A survey of predictive modeling on imbalanced domains
  • Multivariate comparison of classification performance measures
  • Classification assessment methods
  • The impact of class imbalance in classification performance metrics based on the binary confusion matrix
  • Measuring Classification Performance: the hmeasure Package
  • An analysis of performance measures for binary classifiers (opens the publisher in a new tab)
  • Accurate cancer classification using expressions of very few genes
  • Beyond accuracy, F-score and ROC: a family of discriminant measures for performance evaluation
  • Evaluation measures of the classification performance of imbalanced data sets
  • Evaluation measures for models assessment over imbalanced data sets
  • Predictive accuracy: a misleading performance measure for highly imbalanced data
  • Psychometric Methods
  • Mathematical Methods of Statistics
  • Comparison of the predicted and observed secondary structure of T4 phage lysozyme
  • Assessing the accuracy of prediction algorithms for classification: an overview
  • Comparing two K-category assignments by a K-category correlation coefficient
  • Research on the Matthews correlation coefficients metrics of personalized recommendation algorithm evaluation
  • Precision and recall oncology: combining multiple gene mutations for improved identification of drug-sensitive tumours
  • Classifiers and their metrics quantified
  • Optimal classifier for imbalanced data using Matthews correlation coefficient metric
  • The relationship between recall and precision
  • The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets
  • Measures of the amount of ecologic association between species ecology
  • A method of establishing groups of equal amplitude in plant sociology based on similarity of species and its application to analyses of the vegetation on Danish commons
  • Foundations of evaluation
  • Information Retrieval
  • MUC-4 evaluation metrics
  • Morphometric analysis of white matter lesions in MR images: method and validation
  • The pragmatics of information retrieval experimentation
  • The pragmatics of information retrieval experimentation, revisited
  • Evaluating text categorization (opens the publisher in a new tab)
  • RCV1: a new benchmark collection for text categorization research
  • Random k-labelsets for multilabel classification
  • Designing multi-label classifiers that maximize F measures: state of the art
  • Optimal thresholding of classifiers to maximize F1 measure
  • The truth of the F-measure
  • J Am Med Inform Assoc
  • What the F-measure doesn't measure (opens arXiv in a new tab)
  • Macro-and micro-averaged evaluation measures
  • Precision-Recall-Gain curves: PR analysis done right
  • Against the F-score
  • A note on using the F-measure for evaluating record linkage algorithms
  • Local epigenomic state cannot discriminate interacting and non-interacting enhancer-promoter pairs with high accuracy
  • A coefficient of agreement for nominal scales
  • The measurement of observer agreement for categorical data
  • Interater reliability: the Kappa statistic
  • The disagreeable behaviour of the kappa statistic
  • The problem with Kappa
  • Why Cohen's Kappa should be avoided as performance measure in classification
  • Comparison of classification accuracy using Cohen's Weighted Kappa
  • Strategies for learning in class imbalance problems
  • A novel measure for evaluating classifiers
  • Enhancing confusion entropy (CEN) for binary and multiclass classification
  • A comparison of MCC and CEN error measures in multi-class prediction
  • An axiomatically derived measure for the evaluation of classification algorithms
  • On extending F-measure and G-mean metrics to multi-class problems
  • The balanced accuracy and its posterior distribution (opens the publisher in a new tab)
  • Evaluation of approximate rank-order clustering using Matthews correlation coefficient
  • The meaning and use of the area under a receiver operating characteristic (ROC) curve
  • The use of the area under the ROC curve in the evaluation of machine learning algorithms
  • The geometry of ROC space: understanding machine learning metrics through ROC isometrics
  • Using AUC and accuracy in evaluating learning algorithms
  • An introduction to ROC analysis
  • Evaluating diagnostic tests: the area under the ROC curve and the balance of errors
  • Various performance measures in binary classification – An overview of ROC study
  • AUC: a misleading measure of the performance of predictive distribution models
  • Small-sample precision of ROC-related estimates
  • Measuring classifier performance: a coherent alternative to the area under the ROC curve
  • A coherent interpretation of AUC as a measure of aggregated classification performance
  • Area under precision-recall curves for weighted and unweighted data
  • Ten quick tips for machine learning in computational biology
  • The precision-recall curve overcame the optimism of the receiver operating characteristic curve in rare diseases
  • Class prediction for high-dimensional class-imbalanced data
  • Pearson's correlation coefficient
  • Comparison of values of Pearson's and Spearman's correlation coefficients on the same sets of data
  • Extended Spearman and Kendall coefficients for gene annotation list correlation (opens the publisher in a new tab)
  • Broad patterns of gene expression revealed by clustering analysis of tumor and normal colon tissues probed by oligonucleotide arrays

Couldn't load all references. Reload the page to try again.

Cited by (18)