Matthews correlation coefficient


The Matthews correlation coefficient is used in machine learning as a measure of the quality of binary (two-class) classifications. It takes into account true and false positives and negatives and is generally regarded as a balanced measure which can be used even if the classes are of very different sizes. The MCC is in essence a correlation coefficient between the observed and predicted binary classifications; it returns a value between −1 and +1. A coefficient of +1 represents a perfect prediction, 0 no better than random prediction and −1 indicates total disagreement between prediction and observation. While there is no perfect way of describing the confusion matrix of true and false positives and negatives by a single number, the Matthews correlation coefficient is generally regarded as being one of the best such measures. The MCC can be calculated directly from the confusion matrix.

Related formulas


MCCMatthews correlation coefficient (dimensionless)
TPNumber of True Positives (correctly identified) (dimensionless)
TNNumber of True Negatives (correctly rejected) (dimensionless)
FPNumber of False Positive (incorrectly identified) (dimensionless)
FNNumber of False Negatives ( incorrectly rejected) (dimensionless)