Text Classification Metrics Calculator

Evaluate binary, multiclass, and multilabel text classifiers with comprehensive metrics, threshold tuning, visual reports, model comparisons, exports, formulas, examples, and clear guidance for decisions.

Calculator Settings

Choose one input mode and configure the report.

Label Input

Use one pair per line. Separate values with a comma, tab, pipe, or semicolon.
Headers may include actual, predicted, score, or probability.

Formula Used

Accuracy
(TP + TN) / Total

Accuracy measures all correct predictions. It may mislead on imbalanced data. Review balanced metrics before making important model decisions.

Precision
TP / (TP + FP)

Precision measures positive prediction reliability. High precision reduces false alarms. Use it when incorrect positives create meaningful costs.

Recall
TP / (TP + FN)

Recall measures positive case coverage. High recall reduces missed cases. Use it when omissions create serious operational consequences.

F-beta
(1 + β²)PR / (β²P + R)

F-beta combines precision and recall. Beta controls their relative importance. Choose beta carefully for your application priorities.

Specificity
TN / (TN + FP)

Specificity measures negative case recognition. It complements recall directly. Use both when class errors have different impacts.

Matthews correlation
Correlation between truth and predictions

MCC summarizes all confusion counts. It remains useful with imbalance. Values approach one when predictions become highly reliable.

How to Use

1. Choose a mode

Select labels, probabilities, matrices, multilabel data, or comparison. Match the mode to your available model outputs. Correct input selection prevents misleading metric calculations.

2. Enter data

Paste rows or upload a CSV file. Review class names and threshold settings. Remove missing values before calculating your final report.

3. Review results

Compare overall and per-class metrics. Inspect confusion patterns and threshold tradeoffs. Export the finished report for documentation and sharing.

Example Data

Text sampleActual classPredicted classPositive probability
The service was excellent.positivepositive0.94
The delivery arrived late.negativenegative0.12
The product is acceptable.neutralpositive0.61
I would purchase again.positivepositive0.89

Frequently Asked Questions

Which metric should I prioritize?

Choose metrics from business costs. Precision controls false positives. Recall controls false negatives across important classes.

Why can accuracy be misleading?

Dominant classes can inflate accuracy. Minority performance may remain poor. Balanced accuracy and macro F1 expose this problem.

What does macro averaging mean?

Macro averaging treats classes equally. Each class contributes one metric value. It highlights weak minority-class performance clearly.

What does weighted averaging mean?

Weighted averaging uses class support. Larger classes influence results more. It reflects overall dataset composition more closely.

When should I use micro averaging?

Micro averaging pools all decisions. Frequent classes dominate combined counts. It works well for global system performance.

What threshold should I use?

Start with the default threshold. Then inspect precision-recall tradeoffs. Select a threshold matching real error costs.

What is multilabel subset accuracy?

Subset accuracy requires exact label matches. One missing label makes a sample incorrect. Hamming metrics provide softer evaluation.

How is ROC AUC interpreted?

ROC AUC measures ranking quality. Values near one indicate strong separation. Imbalanced datasets may favor precision-recall analysis instead.

Can I compare two models?

Yes, use comparison mode. It calculates matching metrics separately. The report highlights differences and stronger overall results.

Related Calculators

Word Frequency CalculatorCosine Text Similarity CalculatorJaccard Text Similarity CalculatorLevenshtein Distance CalculatorBLEU Score CalculatorROUGE Score CalculatorPerplexity CalculatorVocabulary Size CalculatorToken Count CalculatorNatural Language Processing Basics Quiz

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.