Opening your learning space
Starting the app …
Opening your learning space
Starting the app …
MCC combines all four cells of a binary confusion matrix into a correlation-like metric.
Free to browse · flashcards or a multiple-choice quiz · import from Essential
Formula
dimensionless; from −1 to +1, denominator may be zero for a degenerate confusion matrix
| Symbol | Meaning | Unit |
|---|---|---|
| True positive cases | count | |
| True negative cases | count | |
| False positive cases | count | |
| False negative cases | count |
\mathrm{MCC}=\frac{TP\,TN-FP\,FN}{\sqrt{(TP+FP)(TP+FN)(TN+FP)(TN+FN)}}MCC is the Pearson correlation coefficient between binary observed and predicted labels. It uses TP, TN, FP and FN, and can be more informative than accuracy when class frequencies are very unequal. +1 means perfect agreement, 0 indicates no linear association and −1 means complete reversal. If an actual or predicted class is constant, the denominator can be zero; report the software convention used in that case.
MCC is the Pearson correlation coefficient between binary observed and predicted labels. It uses TP, TN, FP and FN, and can be more informative than accuracy when class frequencies are very unequal. +1 means perfect agreement, 0 indicates no linear association and −1 means complete reversal. If an actual or predicted class is constant, the denominator can be zero; report the software convention used in that case.
MCC combines all four cells of a binary confusion matrix into a correlation-like metric.
Cross-product difference
Only when the denominator is positive.
Use the example for Matthews correlation coefficient (MCC) to explain which inputs determine the requested output.
The example connects concrete inputs to its result.
MCC combines all four cells of a binary confusion matrix into a correlation-like metric.
The relation applies only under its stated assumptions.
Applying the relation to a different case without checking its stated assumptions.
Check the validity range before substituting values: MCC is the Pearson correlation coefficient between binary observed and predicted labels. It uses TP, TN, FP and FN, and can be more informative than accuracy when class frequencies are.
Formula cluster
MCC combines all four cells of a binary confusion matrix into a correlation-like metric.
For TP=40,TN=50,FP=10,FN=5, MCC=1950/√(50·45·60·55)≈0.716. This is positive but not perfect agreement.
Compare binary classifiers on imbalanced data using one score that includes both error types.
Here is how to work through a typical Matthews correlation coefficient (MCC) (MCC = (TP·TN − FP·FN)/√…) task step by step:
Task
Use the example for Matthews correlation coefficient (MCC) to explain which inputs determine the requested output.
Solution path
The example connects concrete inputs to its result.
MCC combines all four cells of a binary confusion matrix into a correlation-like metric.
The relation applies only under its stated assumptions.
The Matthews correlation coefficient compares binary predictions with actual labels and ranges from −1 to +1. +1 means perfect agreement, 0 no linear association and −1 complete reversal. Unlike accuracy, it uses positive and negative cases and both error types. A moderate positive value indicates association, not necessarily calibration or practical suitability. MCC uses all four cells of the binary confusion matrix. State label encoding, test population and zero-denominator handling so the sign and comparison are interpretable. For small samples, add the confusion matrix or an uncertainty interval. This makes the score auditable.
Compute TP·TN−FP·FN in the numerator. Multiply the four marginal sums in the denominator, take the square root and divide. With TP=40,TN=50,FP=10,FN=5, this gives 1950/√(50·45·60·55)≈0.716. The result is dimensionless. Check parentheses and cell assignments because one misplaced count changes both numerator and several marginal sums. MCC uses all four cells of the binary confusion matrix. State label encoding, test population and zero-denominator handling so the sign and comparison are interpretable. For small samples, add the confusion matrix or an uncertainty interval. This makes the score auditable.
Accuracy can look high with rare positives when a model nearly always predicts the majority class. MCC also includes TN, FP and FN, making one-sided behavior more visible. This can be more informative for binary comparisons with class imbalance. It does not replace cost analysis: a false negative may matter much more than a false positive. MCC uses all four cells of the binary confusion matrix. State label encoding, test population and zero-denominator handling so the sign and comparison are interpretable. For small samples, add the confusion matrix or an uncertainty interval. This makes the score auditable.
A negative MCC indicates that predictions and actual labels tend to be inversely associated in the evaluated data. At −1 they are completely reversed; values near zero show little linear agreement. First check whether labels were swapped or matrix columns misread. With consistent coding, a negative value may indicate predictions systematically aligned worse than chance. MCC uses all four cells of the binary confusion matrix. State label encoding, test population and zero-denominator handling so the sign and comparison are interpretable. For small samples, add the confusion matrix or an uncertainty interval. This makes the score auditable.
The denominator is zero if a marginal sum is zero, for example when predictions or test data contain only one class. The variation required for correlation is missing. Software may warn or apply a convention such as zero. Report that choice and include the confusion matrix; a fallback must not be mistaken for a measured correlation. MCC uses all four cells of the binary confusion matrix. State label encoding, test population and zero-denominator handling so the sign and comparison are interpretable. For small samples, add the confusion matrix or an uncertainty interval. This makes the score auditable.
Quanta exam set
Curated exam set for "Matthews correlation coefficient (MCC)":
Question (front)
Which formula describes Matthews correlation coefficient (MCC)?
Answer in your set
Question (front)
How do you rearrange Matthews correlation coefficient (MCC) for Cross-product difference?
Answer in your set
Question (front)
Which common mistake happens with Matthews correlation coefficient (MCC)?
Answer in your set
+ 7 more cards: units, variables, derivation, example, exam task
The formula set contains 10 cards. After importing, review them and start practicing; your ratings determine later review intervals.
This list names subject references and further reading. A page or section number appears when it is part of the reference; these are not verbatim quotations.
Create a curated FSRS exam set for MCC = (TP·TN − FP·FN)/√…: formula recall, variables, derivation, rearrangement, worked example, common mistakes and exam context.
Curated formula set · LaTeX · FSRS spaced repetition · import from Essential