ML · Extended learning

ML confusion-matrix calculator

Compute named metrics from integer TP/FP/FN/TN counts and show the count chart.

Run the local exercise

Key results

MetricValueUnit
Precision84%
Recall77.8%
F180.8%
Accuracy90%
  • Precision and recall are N/A only when their denominators are zero; F1 is 0 when 2TP + FP + FN is positive and TP is zero.
Confusion-matrix countsTP true positives42 countFP false positives8 countFN false negatives12 countTN true negatives138 count

Experiment steps

  1. Enter non-negative integer counts; decimals and non-finite values are rejected.
  2. Read Precision, Recall, F1, Accuracy, and the TP/FP/FN/TN count chart.
  3. Discuss offline metrics separately from business outcome, safety thresholds, and data representativeness.

Sources, formula, and limitations

Original synthetic integer counts; Precision = TP/(TP+FP), Recall = TP/(TP+FN), F1 = 2TP/(2TP+FP+FN), Accuracy = (TP+TN)/total.

Not from a trained model, test set, or online telemetry; metrics with zero denominators display as N/A.

Synthetic counts do not represent a real model, dataset, online risk, or business value.