# Confusion Matrix for Multiclass Classification

## Deriving metrics for multiclass classification from the confusion matrix.

6 min readSep 15, 2022

The confusion matrix is an n*n matrix that is used to measure the performance of classification models. In this article, we will learn how to use the confusion matrix for multiclass classification. Like what metrics can be derived from the confusion matrix and how to calculate the metrics for each class and how to plot the confusion matrix.

I have covered the below-mentioned questions in this article.

- How to plot the confusion matrix?
- Which axis contains actual values and which axis contains predicted values?
- How to find the order of labels in the confusion matrix?
- What metrics can be derived from the confusion matrix?
- How to visualize the confusion matrix?
- How to find the metrics of one class in a multiclass confusion matrix?
- What is a Classification report?
- How to calculate the macro average and weighted average scores?

In this tutorial, I have taken the Iris dataset.