Precision & Recall in
Multiclass Classification

Prof. Dr. Mirco Schoenfeld

confusion matrix

In binary classification, we have this:

https://en.wikipedia.org/wiki/Confusion_matrix

multiclass?

But how is it in multiclass classification?

We usually do not have any notions of positive or negative.

multiclass, not multilabel

We only consider multiclass, not multilabel classification.

Accuracy

For accuracy, this is easy:

\(\text{Accuracy} = \frac{\text{Correct predictions}}{\text{All predictions}}\)

Downsides of accuracy

As always, accuracy is not the perfect measurement.

It disregards class balance and the cost of different errors.

An example

https://www.evidentlyai.com/classification-metrics/multi-class-metrics

An example

https://www.evidentlyai.com/classification-metrics/multi-class-metrics

Precision and Recall in Multiclass classification

To consider precision and recall in multiclass classification,
obtain these metrics for each class individually.

Precision and Recall in Multiclass classification

For Class A, this becomes:

\(\text{Precision}_{\text{Class A}} = \frac{\text{TP}_{\text{Class A}}}{\text{TP}_{\text{Class A}} + \text{FP}_{\text{Class A}}}\)

\(\text{Recall}_{\text{Class A}} = \frac{\text{TP}_{\text{Class A}}}{\text{TP}_{\text{Class A}} + \text{FN}_{\text{Class A}}}\)

Precision and Recall in Multiclass classification

https://www.evidentlyai.com/classification-metrics/multi-class-metrics

Precision and Recall in Multiclass classification

https://www.evidentlyai.com/classification-metrics/multi-class-metrics

Precision and Recall in Multiclass classification

https://www.evidentlyai.com/classification-metrics/multi-class-metrics

Precision and Recall in Multiclass classification