Classification Matrix

When evaluating categorical prediction results, a classification matrix, also known as the confusion matrix, is the common way that models are evaluated. The confusion matrix has two axes. Along the top and running down the columns is the predicted dimension. That is what the classifier predicts in terms of whether observations are positive or true versus negative or false. Along the left side is the actual results.  That is, whether the observations actually have or do not have the attribute of interest.  

Classification algorithms have two ways of being right and two ways of being wrong. When an algorithm predicts instances to be positive and they are actually positive this is called a true positive (TP). When an algorithm predicted instances are negative and they are actually negative, this is called a true negative (TN).

When an algorithm predicts instances as positive that are in reality negative this is called a false positive (FP) or a Type 1 Error. When an algorithm predicted instances are negative that are in reality positive, this is called a false negative (TN) or a Type 2 Error.

As shown below, sometimes classification matrices are presented in counts and sometimes they are presented in terms of the corresponding percentages. Both are correct.