0
$\begingroup$

When training my model and reviewing the confusion matrix, there are completely zero columns for each specific category, what does this mean, is there an error or how do I interpret it?

I use the confusion matrix display function and it gives this result

enter image description here

Thanks for your answers

$\endgroup$

2 Answers 2

0
$\begingroup$

If the plot is correct, it means the model never gives any predictions label of 1 and 2.

$\endgroup$
3
  • $\begingroup$ Do you have any idea why this is happening? $\endgroup$ Jun 13, 2022 at 3:15
  • $\begingroup$ Can be a lot of reasons - Model overfit/underfit, class imbalance, or simply manual error. From your matrix, label 1 and 2 have fewer samples, so class imbalance would be the 1st thing I look at. $\endgroup$
    – lpounng
    Jun 14, 2022 at 2:53
  • 1
    $\begingroup$ BTW, @alexm's answer is more comprehensive than mine, worth reading. $\endgroup$
    – lpounng
    Jun 14, 2022 at 2:54
2
$\begingroup$

The entry $[i, j]$ in a confusion matrix is the number of times the class $j$ was predicted while the correct class was $i$.

For example, $C[1, 1]$ is the number of times your model correctly predicted class $1$. On the other hand, $C[1, 2]$ is the number of times your model predicted $2$ when the correct answer was $1$.

In your case, the entries in $C[1, i]$ and $C[2, i]$ are $0$ for any $i$, which means that your model never predicts classes $1$ and $2$.

$\endgroup$

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.