Generalized Confusion Matrix For Multiple Classes
Generalized Confusion Matrix For Multiple Classes
net/publication/310799885
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.
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
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]
𝑂𝑉𝐸𝑅𝐴𝐿𝐿 𝐴𝐶𝐶𝑈𝑅𝐴𝐶𝑌 =
𝑇𝑜𝑡𝑎𝑙 𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑇𝑒𝑠𝑡𝑖𝑛𝑔 𝐸𝑛𝑡𝑟𝑖𝑒𝑠