My professor gives a multiclass confusion matrix and asks for the error rate of a certain class. Unfortunately, the professor refuses to give a definition.

I think the closest value to an error rate for a class $j$ is the conditional probability $\mathrm{P}(\mathrm{Pred} \neq j ~|~ \mathrm{Truth} = j)$, i.e. the sum of the offdiagonal entries along the $j$-column divided by the sum of all the $j$-column entries. Do you agree?

(I guess the only alternative would be $\mathrm{P}(\mathrm{Truth} \neq j ~|~ \mathrm{Pred} = j)$, which is computed along the $j$-row.)


1 Answer 1


I don't know if this is the definition that you're supposed to use, but usually in multiclass classification the most standard method to apply a binary classification measure is one-vs-rest: given a target class $C$ (positive class), consider all the other classes as a single negative class (i.e. as if they are all merged together).

According to this interpretation, the error rate of a target class $j$ would be the probability of an instance to have different predicted and true class, excluding cases where neither the predicted or true class is $j$ (these are not counted as errors since both the predicted and true class are "negative"),

  • $\begingroup$ Many thanks, @Erwan! Correct me if I am wrong: this is then the sum of all the entries along the $j$-row and $j$-column, excluding the diagonal entry, divided by the sum of the $j$-row and $j$-column, including the diagonal entry? $\endgroup$
    – Pippo
    Jun 14 at 16:37
  • 1
    $\begingroup$ @Pippo: correct for the numerator, but the denominator should be the full sum of the matrix (i.e. total number of instances). $\endgroup$
    – Erwan
    Jun 14 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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