Understanding example of MultiClass Classification

DimpleM 0 Reputation points
2025-02-19T14:21:32.2+00:00

Hello, I am currently reading the module multiclass classification and would like to understand how was TN(true negative) value for Class 0 derived as 5 instead of 4 (Section : The confusion matrix for a multiclass classifier). Can some-one help me understand that?

https://learn.microsoft.com/en-us/training/modules/fundamentals-machine-learning/6-multiclass-classification

Thanks

This question is related to the following Learning Module

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,141 questions
Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
2,075 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Prashanth Veeragoni 400 Reputation points Microsoft Vendor
    2025-02-20T02:16:03.57+00:00

    Hi DimpleM

    Thank you for reaching out to Microsoft Q&A forum!

    I understand that you would like to understand how the True Negative (TN__)__ value for Class 0 was derived as 5 instead of 4.

    The confusion matrix represents the actual vs. predicted values:

    Actual \ Predicted (y^\hat{y}y^) 0 1 2
    Actual \ Predicted (y^\hat{y}y^) 0 1 2
    0 (Actual 0) 2 0 0
    1 (Actual 1) 0 2 0
    2 (Actual 2) 0 1 2

    TN Calculation for Class 0:

    • True Negatives (TN) for Class 0 are the cases where the actual class is not 0 (i.e., the actual class is either 1 or 2), and the predicted class is also not 0 (i.e., predicted as 1 or 2).
    • To compute TN for Class 0, we exclude:

                Row 0 (actual class 0)

                Column 0 (predicted class 0)

    Extracting relevant values from the confusion matrix:

    Actual \ Predicted (y^\hat{y}y^​) 1 2
    1 (Actual 1) 2 0
    1 (Actual 1) 2 0
    2 (Actual 2) 1 2

    The values contributing to TN for Class 0 are: 2, 0, 1, 2

    Total TN for Class 0 = 2 + 0 + 1 + 2 = 5

    Thus, TN for Class 0 is correctly calculated as 5 instead of 4.

    Hope this helps. Do let us know if you any further queries.  

    ------------- 

    If this answers your query, do click Accept Answer and Yes for was this answer helpful.

    Thank you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.