OhMyCalc

Confusion Matrix Calculator

Calculate accuracy, precision, recall, F1, specificity, and MCC from a confusion matrix. Enter TP, TN, FP, FN to get all key classification metrics.

How to Use the Confusion Matrix Calculator

  1. Enter True Positives (TP).
  2. Enter True Negatives (TN).
  3. Enter False Positives (FP).
  4. Enter False Negatives (FN).
  5. Click Calculate to see all metrics.

Casos de Uso

Fórmula

Accuracy = (TP+TN)/(TP+TN+FP+FN). Precision = TP/(TP+FP). Recall = TP/(TP+FN). F1 = 2PR/(P+R). Specificity = TN/(TN+FP). MCC = (TP×TN−FP×FN)/√((TP+FP)(TP+FN)(TN+FP)(TN+FN)).

Perguntas Frequentes

What is a confusion matrix?
A confusion matrix shows the counts of true positives, true negatives, false positives, and false negatives for a classifier.
What is MCC?
Matthews Correlation Coefficient (MCC) is a balanced measure even for imbalanced classes, ranging from -1 to +1.
What is specificity?
Specificity (true negative rate) = TN / (TN + FP), measuring how well the model identifies negatives.