Skip to content
ENExplore Calculators

Confusion Matrix Metrics Calculator

Work out confusion matrix metrics instantly with clear inputs, formula shown and shareable results.

About Confusion Matrix Metrics Calculator

Precision is the fraction of predicted positives that are correct and recall the fraction of actual positives found. The F1 score is their harmonic mean, which is far more informative than accuracy when classes are imbalanced.

Formulas

Precision and recall

P = TP/(TP + FP), R = TP/(TP + FN)

F1 score

F1 = 2PR / (P + R)

Worked example

With the default values below, Confusion Matrix Metrics Calculator returns F1 score of 0.73684211. Change any input above and every figure here is recalculated in your browser.

Inputs used

True positivesminimum 0
70
False positivesminimum 0
20
False negativesminimum 0
30
True negativesminimum 0
880

Results

F1 score
0.73684211
Precision
0.77777778
Recall
0.70000000
Accuracy
0.95000000

Step by step

  1. 1Values used
  2. 2Precision and recall
  3. 3F1 score
  4. 4F1 score= 0.73684211
  5. 5Precision= 0.77777778
  6. 6Recall= 0.70000000
  7. 7Accuracy= 0.95000000

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 8 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

For 70 TP, 20 FP, 30 FN and 880 TN?

Precision is 0.7778, recall 0.7 and F1 0.7368, while accuracy looks flattering at 0.95.

Why is accuracy misleading?

With 95% negatives, always predicting negative scores 95% accuracy while catching nothing — F1 exposes that immediately.

Confusion Matrix Metrics Calculator | Calcrivo