Information Technology Reference
In-Depth Information
as the number of available activities, prediction speed and memory consumption,
can support the selection of HAR algorithms.
2.5.4.1 Confusion Matrix
A common method to visualize the performance of an ML algorithm is through the
confusion matrix
, also called contingency table . Assuming there are m classes
available, a typical confusion matrix consists of a squared matrix of size m
C
m
where misclassifications are visible outside the diagonal. For example, if we consider
a dataset composed of n patterns, where each one corresponds to an ordered pair of
extracted features and their corresponding activity label
×
(
x i ,
y i )
i
∈ {
1
,...,
n
}
,
d , and y i
x i
∈ R
∈ {
1
,...,
m
}
, we can obtain
C
when provided with the predicted
labels f c (
.
Rows represent the actual activities and columns the predicted ones. Therefore,
each matrix cell
x
)
C i , j shows the number of instances of activity i that were predicted
as activity j . It is clear then that all the values within the matrix diagonal are correct
predictions and classification errors otherwise. From this matrix, we can visualize
four different helpful values used to estimate the various statistical measures regard-
ing the system performance. These are visible in the simplified confusion matrix of
two classes ( a and b ) from Table 2.4 . We take these values assuming class a is the
class of interest or positive condition.
True Positives ( TP ): actual samples of class a correctly predicted as class a
True Negatives ( TN ): actual samples of class b correctly predicted as class b
False Positives ( FP ): actual samples of class b incorrectly predicted as class a
False Negatives ( FN ): actual samples of class a incorrectly predicted as class b
2.5.4.2 Accuracy, Sensitivity and Specificity
The accuracy can be obtained as the proportion of the true results ( TP and TN ) with
respect to the total number of instances in the population:
+
TP
TN
=
accuracy
(2.20)
TP
+
FP
+
FN
+
TN
Table 2.4 The four
fundamental numbers for
estimating statistical
performance measures of a
classifier
Actual class
Predicted class
a
b
a
True positives
False negatives
b
False positives
True negatives
 
Search WWH ::




Custom Search