Matthews Correlation Calculator

Evaluate binary model agreement using confusion matrix counts with exports, derived metrics, and reporting support. Interpret imbalanced classification performance with balanced context and clarity.

Calculator Inputs

Example Data Table

Dataset TP TN FP FN Expected Insight
Validation Set A 85 120 15 20 Strong balanced agreement across both classes.
Fraud Review Batch 41 880 19 35 Imbalance makes MCC more informative than accuracy.
Medical Screening Fold 62 310 28 17 Useful for comparing recall against false alarms.

Formula Used

The Matthews Correlation Coefficient measures binary classification quality using every cell in the confusion matrix. It stays informative even when classes are imbalanced.

MCC = ((TP × TN) − (FP × FN)) / √((TP + FP)(TP + FN)(TN + FP)(TN + FN))

TP means correctly predicted positives. TN means correctly predicted negatives. FP means predicted positive but actually negative. FN means predicted negative but actually positive.

An MCC near +1 indicates strong agreement, 0 suggests random-like performance, and -1 signals total disagreement between predictions and actual labels.

How to Use This Calculator

  1. Enter the dataset name and class labels for clear reporting.
  2. Fill in true positives, true negatives, false positives, and false negatives.
  3. Press Calculate MCC to show results above the form.
  4. Review MCC beside accuracy, precision, recall, specificity, and F1 score.
  5. Use the export buttons to download CSV or PDF summaries.
  6. Compare multiple model runs using the same confusion matrix structure.

Why Matthews Correlation Matters

Many binary metrics ignore part of the confusion matrix or become overly optimistic when one class dominates. Matthews correlation includes all four outcomes, making it valuable for imbalanced datasets, screening tasks, fraud detection, anomaly review, and model validation pipelines.

This page also reports accuracy, precision, recall, specificity, balanced accuracy, prevalence, and error rate. Together, these measures help you understand whether a strong MCC comes from genuine class balance or from one dominant prediction pattern.

FAQs

1. What does MCC measure?

MCC measures agreement between predicted and actual binary labels using all confusion matrix cells. It is useful when classes are imbalanced.

2. Why use MCC instead of accuracy?

Accuracy can look high when one class is much larger. MCC penalizes one-sided predictions and gives a more balanced evaluation.

3. What is a good MCC value?

Values near 1 show strong agreement. Values around 0 suggest weak predictive value. Negative values indicate systematic disagreement.

4. Can MCC handle imbalanced data?

Yes. MCC is often preferred for imbalanced binary classification because it uses true and false counts from both classes.

5. When is MCC undefined?

MCC becomes undefined when any confusion matrix margin is zero, such as no predicted positives or no actual negatives.

6. Does this calculator export results?

Yes. After calculation, you can download a CSV file or a simple PDF summary for reporting and review.

7. Does MCC replace precision and recall?

No. MCC complements them. Precision and recall show class-specific behavior, while MCC summarizes overall binary agreement.

8. Can I compare two models with this page?

Yes. Enter each model’s confusion matrix separately, then compare MCC and supporting metrics across runs or folds.

Related Calculators

cohen kappa calculatormisclassification rate calculatortrue positive rate calculatorjaccard index calculatormulticlass confusion matrix calculatorscore prediction calculatory balance test scoring calculatorprecision score logistic regressionap macro frq score calculatormulticlass confusion matrix online calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.