specificity for 3 class

I was reading an answer in qoura to calculate the specificity of a 3 class classifier from a confusion matrix. In the below answer

https://www.quora.com/How-do-I-get-specificity-and-sensitivity-from-a-three-classes-confusion-matrix

For below 3-class confusion matrix, The below is a screenshot from the answer.

the sensitivity and specificity would be found by calculating the following:

My question is in numerator for specificity which is false negatives shouldnt it be 4 terms. Eg if we are calculating w/r 1, Then in the table n22,n33,n32 and n23 were all got predicted as negatives(as they are not 1). And they are true too.

So shouldnt the formula be

specificity(w/r) Class 1 = n22+n33+n32+n23/(n22+n33+n32+n23+n31+n21)

Topic metric confusion-matrix classification

Category Data Science


I'm going to write an answer just for confirming: yes, you're totally right, this is an error in the Quora answer.

Indeed, when using evaluation measures for binary classification in a multiclass setting one has to calculate for each class independently. The target class is considered the positive class, so logically all the other classes must be considered as the one negative class, i.e. merged together.

I agree that in the case of specificity for class 1, this gives the formula that you found.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.