0% found this document useful (0 votes)
124 views3 pages

Generalized Confusion Matrix For Multiple Classes

This document presents a generalized format for a confusion matrix with multiple classes and equations to calculate performance metrics like precision, recall, and specificity for each class. The confusion matrix table shows the predicted versus actual classifications with n classes. Equations 1-4 are used to calculate false negatives, false positives, true negatives for each class from the matrix. Equations 5-7 then calculate the precision, recall, and specificity for each class. Equation 8 provides an overall accuracy measure for the system.

Uploaded by

Fira Sukmanisa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views3 pages

Generalized Confusion Matrix For Multiple Classes

This document presents a generalized format for a confusion matrix with multiple classes and equations to calculate performance metrics like precision, recall, and specificity for each class. The confusion matrix table shows the predicted versus actual classifications with n classes. Equations 1-4 are used to calculate false negatives, false positives, true negatives for each class from the matrix. Equations 5-7 then calculate the precision, recall, and specificity for each class. Equation 8 provides an overall accuracy measure for the system.

Uploaded by

Fira Sukmanisa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/310799885

Generalized Confusion Matrix for Multiple Classes

Research · November 2016


DOI: 10.13140/RG.2.2.31150.51523

CITATIONS READS
12 8,898

1 author:

Cinmayii Manliguez
University of the Philippines
8 PUBLICATIONS   29 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

LiDAR Data Processing and Validation in Mindanao: Davao Region View project

All content following this page was uploaded by Cinmayii Manliguez on 25 November 2016.

The user has requested enhancement of the downloaded file.


Generalized Confusion Matrix for Multiple Classes
Garillos-Manliguez, C.A.
[email protected]
November 25, 2016

This document was made due to the lack of resources to reference for confusion matrix
with multiple classes and no generalized formulae are used for calculating the precision,
recall, specificity, and overall accuracy of the system having many classes to consider.

The following table shows a sample format of a confusion matrix with n classes:

Predicted Number
Class 1 Class 2 … Class n
Class 1 𝑥11 𝑥12 … 𝑥1𝑛
Actual Number

Class 2 𝑥21 𝑥22 … 𝑥2𝑛


. . . . .
. . . . .
. . . . .
Class n 𝑥𝑛1 𝑥𝑛2 … 𝑥𝑛𝑛

The total numbers of false negative (TFN), false positive (TFP), and true
negative (TTN) for each class i will be calculated based on the Generalized
Equations 1, 2, and 3, respectively. The total true positive in the system will
be obtained through Equation 4.
𝑛
[1]
𝑇𝐹𝑁𝑖 = ∑ 𝑥𝑖𝑗
𝑗=1
𝑗≠ 𝑖
𝑛
[2]
𝑇𝐹𝑃𝑖 = ∑ 𝑥𝑗𝑖
𝑗=1
𝑗≠ 𝑖
𝑛 𝑛
[3]
𝑇𝑇𝑁𝑖 = ∑ ∑ 𝑥𝑗𝑘
𝑗=1 𝑘=1
𝑗≠ 𝑖 𝑘≠𝑖
𝑛
[4]
𝑇𝑇𝑃𝑎𝑙𝑙 = ∑ 𝑥𝑗𝑗
𝑗=1

To compute the generalized precision (P), recall (R), and specificity(S) for
each class i Generalized Equations 5, 6, and 7 will be used.
𝑇𝑇𝑃𝑎𝑙𝑙 [5]
𝑃𝑖 =
𝑇𝑇𝑃𝑎𝑙𝑙 + 𝑇𝐹𝑃𝑖

𝑇𝑇𝑃𝑎𝑙𝑙 [6]
𝑅𝑖 =
𝑇𝑇𝑃𝑎𝑙𝑙 + 𝑇𝐹𝑁𝑖

𝑇𝑇𝑁𝑎𝑙𝑙 [7]
𝑆𝑖 =
𝑇𝑇𝑁𝑎𝑙𝑙 + 𝑇𝐹𝑃𝑖

𝑇𝑇𝑃𝑎𝑙𝑙 [8]
𝑂𝑉𝐸𝑅𝐴𝐿𝐿 𝐴𝐶𝐶𝑈𝑅𝐴𝐶𝑌 =
𝑇𝑜𝑡𝑎𝑙 𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑇𝑒𝑠𝑡𝑖𝑛𝑔 𝐸𝑛𝑡𝑟𝑖𝑒𝑠

View publication stats

You might also like