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


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

enter image description here

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)


1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.