Matthews Correlation Coefficient Formula:
From: | To: |
The Matthews Correlation Coefficient (MCC) is 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 calculator uses the MCC equation:
Where:
Explanation: The MCC 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.
Details: MCC is particularly useful when the two classes are of different sizes (unbalanced datasets). Unlike accuracy, it's not skewed by class imbalance, making it a reliable metric for evaluating binary classifiers.
Tips: Enter the counts of true positives, true negatives, false positives, and false negatives from your confusion matrix. All values must be non-negative integers.
Q1: What is a good MCC score?
A: Generally, MCC > 0.7 indicates a strong correlation, 0.3-0.7 moderate, and < 0.3 weak. However, this depends on your specific application.
Q2: How does MCC compare to F1 score?
A: While F1 score focuses on precision and recall (ignoring true negatives), MCC considers all four confusion matrix categories, making it more balanced.
Q3: When should I use MCC?
A: MCC is particularly useful when you have imbalanced classes and want a metric that considers all aspects of the confusion matrix.
Q4: What does an MCC of 0 mean?
A: An MCC of 0 means your classifier is performing no better than random chance.
Q5: Can MCC be used for multi-class problems?
A: Yes, there are multi-class generalizations of MCC, but this calculator is for binary classification only.