Consider a case where the number of labelled data as 0 = 1400 and labelled as 1 =100. The data labelled as 0 denote normal operating conditions and data labelled as
1 denote abnormal. 0 is no event and 1 is an event.
Assuming the following confusion matrix is obtained for the binary classification in Matlab's
confusionmatrix() function using SVM learner
cmMatrix = predicted 0 predicted 1 truth 0 1100 (TN) 300 (FN) truth 1 30 (TN) 70 (TP) cmMatrix = [1100,300;30,70]; acc_0 = 100*(cmMatrix(1,1))/sum(cmMatrix(1,:)); acc_1 = 100*(cmMatrix(2,2))/sum(cmMatrix(2,:));
acc_0 = 78.5714 and
acc_1 = 70
The confusion matrix is read as out of 1400 normal events, 1100 are correctly identified as normal and 300 are incorrectly identified as abnormal. Then, out of 100 abnormal events, 70 are correctly detected as abnormal whereas 30 are incorrectly detected as abnormal. I want to calculate the sensitivity and specificity with respect t class 1 since that is of primary interest in abnormal event detection. This is how I did
Sensitivity for class 1= TP/(TP+FN) = 70/(70+300) = 0.1892 Specificity for class 0= TN/(TN+FP) = 1100/(1100+30) = 0.9735
where TP with respect to class 1 = 70 FN with respect to class 1 = 300
which means that 18.92% the model will correctly identify abnormal events (with labels 1) and 3% of abnormal events will be incorrectly detected as normal events.
- Sensitivity would refer to the test's ability to correctly detect abnormal events. Is this calculation correct. Did I do any mistake in the calculation?