Confusion matrix
Predicted +Predicted −Actual +Actual −
Enter the four counts. Get 14 metrics, with the working shown.
Only 5% of cases are positive, so accuracy flatters this model. MCC is 0.54.
| Metric | Value | Working |
|---|---|---|
| Accuracy | 0.930 | (TP + TN) / (TP + FP + FN + TN) = (40 + 890) / 1000 |
| Precision | 0.400 | TP / (TP + FP) = 40 / (40 + 60) |
| Recall | 0.800 | TP / (TP + FN) = 40 / (40 + 10) |
| Specificity | 0.937 | TN / (TN + FP) = 890 / (890 + 60) |
| F1 score | 0.533 | 2·TP / (2·TP + FP + FN) = 80 / (80 + 60 + 10) |
| Balanced accuracy | 0.868 | (Recall + Specificity) / 2 |
| Matthews correlation coefficient | 0.535 | (TP·TN − FP·FN) / √((TP+FP)(TP+FN)(TN+FP)(TN+FN)) |
| Cohen's kappa | 0.500 | (p_o − p_e) / (1 − p_e) |
| Negative predictive value | 0.989 | TN / (TN + FN) = 890 / (890 + 10) |
| False positive rate | 0.063 | FP / (FP + TN) = 60 / (60 + 890) |
| False negative rate | 0.200 | FN / (FN + TP) = 10 / (10 + 40) |
| False discovery rate | 0.600 | FP / (FP + TP) = 60 / (60 + 40) |
| Prevalence | 0.050 | (TP + FN) / (TP + FP + FN + TN) = (40 + 10) / 1000 |
| Youden's J statistic | 0.737 | Recall + Specificity − 1 |
— means undefined: the formula divides by zero.
A fraud model checks 1,000 transactions, 50 of them fraud. Accuracy is 0.93, but a model that flags nothing scores 0.95. Precision (0.40) and MCC (0.54) tell the real story.
About · Quizzes · Tools · History of AI · To suggest new questions or report an error send me a dm.