Also it known as an error matrix. Normally, you can identify 4 elements, they known as true positive (TP),
true negative (TN), false positive (FP) and false negative (FN). To understand it, a simple example is presented:
|
Real Values |
|
Estimated |
Class 1 |
Class 2
|
Class 1 |
TP |
FP
|
Class 2 |
FN |
TN |
The problem arises that there is not always a clear relationship between which is the positive class or
there may be different classes so it is also common to use the terms Type I error (FP),
Type II error (FN) and unify the success or accuracy (TP+TN) in a single value.
Suppose a 3x3 table with notation
|
Real Values |
|
Estimated |
Class 1 |
Class 2 |
Class 3
|
Class 1 |
A |
B |
C
|
Class 2 |
D |
E |
F
|
Class 3 |
G |
H |
I |
|
where N = A+B+C+D+E+F+G+H+I
The formulas used here are:
$$Success rate = (A+E+I)/N$$
$$Type I error = (B+F+C)/N$$
$$Type II error = (D+H+G)/N$$
Other indicators depends of one class and in the case choose Class 1
$$Sensitivity Class 1 = A/(A+D+G)$$
$$Specificity Class 1 = (E+I)/(B+E+H+C+F+I)$$
$$Precision Class 1 = A/(A+E+I),$$
also it is called Positive Predictive Value (PPV)
$$Prevalence Class 1 = (A+D+G)/N$$