Confusion Matrix Calculator
Math CalculatorsAccuracy/precision/recall/F1 · 8 metrics
Confusion Matrix Calculator: Accuracy/precision/recall/F1 · 8 metrics. Confusion Matrix Calculator uses standard math formulas to compute accurate results instantly.
How these metrics work
- 1Rows = predicted class, columns = actual class. TP/TN are correct predictions; FP (Type I) and FN (Type II) are the two error types.
- 2Accuracy = (TP+TN)/total = (85+895)/1000 = 98.0%.
- 3Precision = TP/(TP+FP)(predicted positive correctness)= 94.4%; Recall = TP/(TP+FN)(actual positives found)= 85.0%.
- 4F1 = 2·P·R/(P+R) — harmonic mean punishes imbalance; here F1 = 89.5%.
- Class-imbalance trap: with 99% negatives, a lazy model predicting "always negative" scores 99% accuracy but 0% recall — always report precision/recall too.
- Precision vs recall trade-off: raising the classification threshold raises precision and lowers recall; F1 balances both, Fβ (β>1) weights recall more.
- Sensitivity = recall (TP rate); specificity = TN rate. Medical screening favors high sensitivity (miss few patients), confirmatory tests favor high precision.
- Confusion matrix extends beyond 2×2 to multi-class (N×N); per-class precision/recall plus macro/weighted averages are reported.
Was this tool helpful?
How to Use
- Enter values or expressions: type directly into the Confusion Matrix Calculator — keyboard friendly.
- Instant results: everything computes live as you type, no button needed.
- Follow the steps: the result panel shows full working and formula substitution.
- Copy or recompute: one-click copy; change any input to recalculate instantly.
Key Points
- Confusion Matrix Calculator is a free online math tool — open and use, no sign-up.
- All calculations run locally in your browser; your data never leaves the device.
- Key capability: Accuracy/precision/recall/F1 · 8 metrics.
- Results come with formulas and reference tables so you can verify every number.
Formula & How It Works
Confusion Matrix Calculator formula
FAQ
How do I use the Confusion Matrix Calculator?
Are the results accurate?
Is it free? Do I need to sign up?
Does it work on mobile?
Is my data saved?
Related Tools
Basic Calculator
Add, subtract, multiply, divide with full keyboard supportHOTScientific Calculator
Trig, log, exponent, factorial · DEG/RAD modesHOTPercentage Calculator
Percent of, percentage share, and percent changeFraction Calculator
Add, subtract, multiply, divide fractions with simplificationHOTNumber Base Converter
Convert between binary, octal, decimal and hexadecimalPermutation & Combination Calculator
Permutations A(n,m) and combinations C(n,m)Random Number Generator
Custom range, integers or decimals, batch generationPrime Number Tools
Primality test, prime factorization and prime listsRelated Guides
Source & Updates
Standard mathematical formulas. All logic verified. Last updated: 2025-07
Last updated:
Formulas and content on this page are reviewed by the YiJianSuan team. For reference only — official sources prevail.
Maintained and periodically reviewed by the YiJianSuan editorial team — review process in ourEditorial Policy.
Cite this page: YiJianSuan. Confusion Matrix Calculator[EB/OL]. https://www.yijiansuan.com/en/c/math/confusion-matrix
Results provided by this tool are for reference only and do not constitute professional advice.