PERFORMANCE OF A CLASSIFIER
DEFINITIONS
in a classification problem where class is a binary attribute the follow schema can be produced in order to study data
POS-PRED | NEG-PRED | |
---|---|---|
POS-TRUE | ||
NEG-TRUE |
where:
- true positives
- true negatives
- false positives
- false negatives
these measurements can be used to calculate some interesting performance metrics such as
-
SUCCESS RATE (ACCURACY)
accuracy of the classifier
$$
\frac{TP + TN}{Ntest}
$$
-
ERROR RATE
-
PRECISION
rate of true positives among positive classifications
-
RECALL
rate of positives that the classifier can catch (sensitivity)
-
SPECIFICITY
rate of negatives that the classifier can catch
-
F1 SCORE
armonic mean of precision and recall
accuracy gives an inital idea of the performance but can be misleading when classes are unbalanced
f1 score is insteresting because is higher when precision and recall are balanced
if the cost of positive and negative errors are different than precision and recall should be considered
MULTI CLASS CASE
in a problem with non binary class attribute the previous table can be extended, it’s called confusion matrix
a | b | c | Total | |
---|---|---|---|---|
a | ||||
b | ||||
c | ||||
Total | N |
-
true number of labels in the dataset
-
total number of predictions of class
-
true positives for class
-
false positives for class predicted as
-
ACCURACY
-
PRECISION
-
RECALL
these measures can be global:
these measures can be weighted: