ML Tools
Confusion Matrix Calculator
Calculate accuracy, precision, recall, F1, and related metrics.
Accuracy
90%
Precision
0.9091
Recall
0.9091
F1 score
0.9091
Specificity
0.8889
Neg. predictive value
0.8889
False positive rate
0.1111
False negative rate
0.0909
Formulas
Formula
Accuracy = (TP + TN) / (TP + TN + FP + FN)
Precision = TP / (TP + FP)
Recall = TP / (TP + FN)
F1 = 2 × Precision × Recall / (Precision + Recall)
Specificity = TN / (TN + FP)Frequently asked questions
Why is a metric shown as 'Undefined' instead of 0?
A metric is undefined when its denominator is zero — for example, precision is undefined when TP + FP = 0. Showing 0 in that case would misleadingly imply a measured value of zero rather than 'not computable'.
When should I prioritize precision over recall?
It depends on the cost of false positives vs. false negatives in your application. See our precision vs. recall vs. F1 guide for a deeper explanation.