We use cookies for analytics and personalized ads. We use cookies for basic analytics and, where we show ads, to personalize them. Privacy PolicyRead our Privacy Policy.
Turn a confusion matrix into accuracy, precision, recall, F1, specificity, MCC and Cohen's κ, per class and averaged. Works for two classes or up to eight.
Results update as you type. Everything runs in your browser.
Click a preset (spam filter, sentiment, hallucination check) to fill in a matrix.
Choose 2–8 classes and rename them. Existing counts are kept when you resize.
Rows are the actual class, columns are what the model predicted.
For two classes, choose which one counts as positive (for example Spam).
Results update as you type. Check precision and recall, not just accuracy.
| Actual ↓ / Predicted → | ||
|---|---|---|
The diagonal (highlighted) holds the correct predictions. You can paste a matrix from Excel into any cell.
| Average | Precision | Recall | F1 |
|---|---|---|---|
| Macro | 0.902 | 0.889 | 0.894 |
| Weighted | 0.900 | 0.900 | 0.899 |
| Micro | 0.900 | 0.900 | 0.900 |
The model got 90.0% of 150 predictions right. Always guessing the biggest class would score 60.0%, so the model adds real signal. For “Spam”, precision is 90.9% (how many of its alerts were right) and recall is 83.3% (how many real cases it caught), giving F1 = 0.870. MCC of 0.791 and κ of 0.789 indicate strong agreement.
A classifier makes mistakes, and the confusion matrix shows exactly which kind. Precision tells you how trustworthy its positive calls are, recall tells you how many real cases it finds, and F1 combines the two. Use them for spam filters, medical tests and LLM evaluations alike.
A table of counts: rows are the true class, columns the predicted class. The diagonal is what the model got right.
True positive, false positive, false negative, true negative, counted for one class against all the others.
Correct predictions divided by all predictions. Misleading when one class dominates.
Of everything the model called positive, how much really was? TP / (TP + FP).
Of everything that really was positive, how much did the model find? TP / (TP + FN).
Harmonic mean of precision and recall. Low if either one is low.
Of everything that really was negative, how much did the model call negative? TN / (TN + FP).
Single scores that stay honest on imbalanced data. 1 is perfect, 0 is no better than chance.
Macro averages classes equally, weighted by class size, micro pools all counts (equals accuracy).
For each class, TP is the diagonal cell, FP is the rest of its column, FN the rest of its row and TN everything else. Precision = TP/(TP+FP), recall = TP/(TP+FN), F-β = (1+β²)·P·R / (β²·P + R). Macro averages the classes equally, weighted uses class support, micro pools all counts and equals accuracy.
MCC and Cohen's κ use the multiclass formulas from the full matrix. Zero denominators return 0, matching scikit-learn's zero_division=0.