NEW
Also known as: MCC
Balanced correlation metric for classification that considers TP, TN, FP, and FN, robust to class imbalance.
DESCRIPTION
The Matthews Correlation Coefficient summarizes binary (and multiclass) classification quality as a correlation between observed and predicted classes. It uses all entries of the confusion matrix and ranges from −1 (total disagreement) to +1 (perfect prediction), with 0 indicating random performance. MCC is particularly informative under class imbalance, outperforming accuracy and F1 in many settings. It is widely used in bioinformatics and imbalanced learning benchmarks. Many libraries provide MCC for fairer model comparisons.
ALTERNATIVE DEFINITIONS
Wikipedia
The Matthews correlation coefficient (MCC) is used in machine learning as a measure of the quality of binary (two-class) classifications.
Highlights MCC as a quality measure for binary classifications.
scikit-learn
The Matthews correlation coefficient is used for evaluating binary classification and can be generalized to multiclass problems. The coefficient returns a value between −1 and +1.
Notes range and multiclass generalization in a practical API context.
RELATED TERMS
Balanced Accuracy Cohen’s Kappa Confusion Matrix Fowlkes–Mallows Index Precision Recall ROC Curve ROC AUC
COMPETING TERMS
RELATIONS
- Broader: Correlation Coefficient
KNOWLEDGE AREAS
Data Science AI Mathematics Testing & Validation
TARGET AUDIENCE
Data Scientist AI Engineer MLOps Engineer
EXTERNAL SOURCES
- Wikipedia - Matthews correlation coefficient
- scikit-learn - Classification metrics overview including MCC.
- Bioinformatics (OUP) - Paper advocating MCC for imbalanced data.
TOP QUESTIONS
What is the Matthews Correlation Coefficient?
MCC is a correlation-based metric for classification that uses all confusion matrix entries. It provides a balanced assessment even with imbalanced classes.
Category: Definition
Why choose MCC over accuracy?
Accuracy can be misleading with class imbalance, while MCC remains informative by considering TP, TN, FP, and FN together.
Category: Relevancy
What is the range and meaning of MCC values?
MCC ranges from −1 to +1. +1 indicates perfect prediction, 0 is no better than random, and −1 is total disagreement.
Category: Requirements
How does MCC compare to F1 score?
F1 balances precision and recall but ignores true negatives. MCC includes TN and often provides a fairer measure under imbalance.
Category: Alternatives
Is MCC applicable to multiclass problems?
Yes, MCC can be extended to multiclass settings, and many libraries implement this generalization.
Category: Application
What is a common mistake with MCC?
Interpreting MCC without context of class distribution and threshold choice. Always compare alongside other metrics and domain costs.
Category: Mistakes
How to compute MCC in Python?
Use sklearn.metrics.matthews_corrcoef(y_true, y_pred). Ensure labels are aligned and handle multiclass as supported.
Category: How-To
When is MCC especially useful?
When classes are highly imbalanced and false negatives or false positives have asymmetric costs, MCC offers a balanced view.
Category: Example
What affects MCC besides model accuracy?
Decision thresholds, class prevalence, and calibration can shift FP/FN rates, thereby changing MCC.
Category: Opinion