Matthews Correlation Coefficient Calculator
Evaluate a binary classifier from its confusion matrix with MCC, accuracy, precision, recall, and specificity.
About the Matthews correlation coefficient
MCC examples
These confusion matrices illustrate perfect, useful, and reversed classifiers.
| Confusion Matrix | MCC | Interpretation |
|---|---|---|
| TP 50, TN 50, FP 0, FN 0 | 1.000000 | Every case is classified correctly. |
| TP 90, TN 80, FP 10, FN 20 | 0.703526 | Both classes are handled well, with some missed positives and false alarms. |
| TP 0, TN 0, FP 50, FN 50 | -1.000000 | Every prediction is the opposite of the true class. |
How to calculate MCC
- Identify which outcome is the positive class and construct a confusion matrix from evaluation predictions.
- Enter the true-positive, true-negative, false-positive, and false-negative counts.
- Select Calculate MCC to compute the coefficient and supporting performance percentages.
- Compare MCC with precision, recall, specificity, class prevalence, and the practical cost of each error.
Matthews correlation FAQ
Why use MCC instead of accuracy?
Accuracy can look high when a majority class dominates the sample. MCC incorporates all four confusion-matrix cells and penalizes one-sided predictions.
What does a negative MCC mean?
It means predictions are inversely associated with the true labels. A strongly negative classifier may improve if every prediction is reversed, but its pipeline should first be investigated.
Can MCC be undefined?
Yes, its denominator is zero when a required prediction or outcome marginal is empty. The calculator reports this rather than inventing a misleading score.
Is MCC suitable for multiclass models?
This calculator implements the standard binary formula. Generalized multiclass MCC definitions exist, but they require the full multiclass confusion matrix.
Does MCC choose a classification threshold?
No, it evaluates counts produced at the threshold you selected. Compare results over relevant thresholds and choose one based on validation data and error costs.