Confusion Matrix for Text Classes Calculator

Compare text classification labels, inspect confusion patterns, calculate detailed metrics, normalize results, identify weak classes, and export clear reports for practical model evaluation workflows.

Input and data controls

Use one record per line. Quotes are supported.

Column selection and cleaning

Enter one alias=canonical mapping per line.

Matrix, sorting, and display options


Multilabel options

Formula used

Accuracy = correct predictions ÷ all predictions.

Precision = TP ÷ (TP + FP).

Recall = TP ÷ (TP + FN).

Specificity = TN ÷ (TN + FP).

F1 score = 2 × precision × recall ÷ (precision + recall).

How to use

  1. Paste label pairs or upload a delimited file.
  2. Identify actual and predicted label columns.
  3. Choose cleaning, ordering, and normalization settings.
  4. Select a positive class for binary details.
  5. Calculate, inspect errors, and export the report.

Example data table

ActualPredictedPredicted2Text ID
positivepositivepositivedoc-001
negativepositivenegativedoc-002
neutralneutralneutraldoc-003
questioncomplaintquestiondoc-006

Frequently asked questions

What does a diagonal cell mean?

It counts records predicted as their correct class.

Why use row normalization?

It compares prediction outcomes within each actual class.

Why use column normalization?

It shows each predicted class composition by actual labels.

What is macro F1?

It averages class F1 scores without support weighting.

What is weighted F1?

It weights each class F1 using its support.

When is balanced accuracy helpful?

It helps when class sizes differ substantially.

Can this compare two models?

Yes. Provide a second predicted-label column.

Does it support multilabel text?

Yes. Enable multilabel mode and set a separator.

How is PDF export handled?

Use Print or Save PDF in your browser.

Related Calculators

Word Frequency Bar ChartN-gram Frequency ChartDocument-Length HistogramSentiment Distribution PlotTopic Distribution ChartTopic-Term HeatmapWord-Embedding Scatter PlotAttention MatrixToken Probability PlotVocabulary Coverage Curve

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.