Skip to content
Machine Learning

What is the Matthews correlation coefficient?

A single score for a binary classifier that uses all four cells of the confusion matrix: MCC = (TP·TN − FP·FN) / √((TP+FP)(TP+FN)(TN+FP)(TN+FN)). It runs from −1 to 1, with 0 for random guessing, and stays honest on imbalanced data.

datasciencetrivia.com

Card 1 of 259. Answer: A single score for a binary classifier that uses all four cells of the confusion matrix: MCC = (TP·TN − FP·FN) / √((TP+FP)(TP+FN)(TN+FP)(TN+FN)). It runs from −1 to 1, with 0 for random guessing, and stays honest on imbalanced data.

Created by santiviquez

About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.

The longer answer

MCC is the Pearson correlation between the predicted and actual binary labels. It is high only when the model does well on both classes, and it is symmetric: swapping which class is called positive doesn't change it, unlike precision, recall and F1. Brian Matthews used it in 1975 to evaluate protein structure predictions.

Example: 1,000 cases, 50 of them positive. Predicting everything negative gives 95% accuracy and an MCC of 0. A real model with TP = 40, FN = 10, FP = 60 and TN = 890 has 93% accuracy, lower than the useless one, but an MCC of (40 × 890 − 60 × 10) / √(100 × 50 × 950 × 900) ≈ 0.54. Its F1 is 0.53 and its balanced accuracy 0.87.

Chicco and Jurman (2020) argued that MCC is more informative than accuracy and F1 for binary classification, since it can't be high unless all four cells are good. Balanced accuracy, the average of sensitivity and specificity, is another prevalence-robust option. MCC is undefined when a whole row or column of the confusion matrix is zero; libraries return 0 in that case.

All questions