MCC
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
MCC = (TP·TN-FP·FN)/√((TP+FP)(TP+FN)(TN+FP)(TN+FN))
About this calculator
The Matthews Correlation Coefficient (MCC) is a statistical measure used to evaluate the performance of classification models, especially in situations where classes are imbalanced. It takes into account true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN) to provide an overall view of the model's accuracy.
The MCC formula is: MCC = (TP·TN - FP·FN) / √((TP+FP)(TP+FN)(TN+FP)(TN+FN)). This allows the MCC to provide a balanced measure of the model's performance, even when classes have different sizes. The result ranges from -1 to 1, where 1 indicates perfect prediction, 0 indicates random prediction, and -1 indicates perfectly wrong prediction.
The MCC is particularly useful in cases where the class distribution is unequal, such as in fraud detection or rare disease diagnosis problems. In these cases, metrics like accuracy can be misleading, as a model that always predicts the majority class can achieve high accuracy but is not useful in practice.
When using MCC, it's essential to be careful with result interpretation, especially in situations where TP, TN, FP, and FN values are small. Additionally, MCC can be sensitive to changes in classification thresholds, so it's crucial to consider different scenarios and thresholds when evaluating model performance.
Frequently asked questions
What is the Matthews Correlation Coefficient (MCC)?
MCC is a statistical measure used to evaluate the performance of classification models, especially in imbalanced class situations.
How is MCC calculated?
MCC is calculated using the formula: MCC = (TP·TN - FP·FN) / √((TP+FP)(TP+FN)(TN+FP)(TN+FN)).
When to use MCC?
MCC is particularly useful in cases of imbalanced classes, such as fraud detection or rare disease diagnosis.
What are the precautions when using MCC?
It's essential to be careful with result interpretation, especially with small TP, TN, FP, and FN values, and consider different scenarios and thresholds.