How to read the classifier confusion matrix in WEKA

JakeSays picture JakeSays · Mar 5, 2013 · Viewed 39.9k times · Source

Sorry, I am new to WEKA and just learning.

In my decision tree (J48) classifier output, there is a confusion Matrix:

a    b   <----- classified as
130  8     a = functional
15   150   b = non-functional
  • How do I read this matrix? What's the difference between a & b?
  • Also, can anyone explain to me what domain values are?

Answer

Junuxx picture Junuxx · Mar 5, 2013

Have you read the wikipedia page on confusion matrices? The text around the matrix is arranged slightly differently in their example (row labels on the left instead of on the right), but you read it just the same.

The row indicates the true class, the column indicates the classifier output. Each entry, then, gives the number of instances of <row> that were classified as <column>. In your example, 15 Bs were (incorrectly) classified as As, 150 Bs were correctly classified as Bs, etc.

As a result, all correct classifications are on the top-left to bottom-right diagonal. Everything off that diagonal is an incorrect classification of some sort.

Edit: The Wikipedia page has since switched the rows and columns around. This happens. When studying a confusion matrix, always make sure to check the labels to see whether it's true classes in rows, predicted class in columns or the other way around.