What is the Confusion Matrix?
A confusion matrix is a table that is often used to describe the performance of a classification model (or “classifier”) on a set of test data for which the true values are known.
It allows the visualization of the performance of an algorithm.
A confusion matrix is a summary of prediction results on a classification problem.
The number of correct and incorrect predictions is summarized with count values and broken down by each class.
This is the key to the confusion matrix.
It gives us insight not only into the errors being made by a classifier but, more importantly, the types of errors that are being made.
Here,
Class 1: Positive
Class 2: Negative
Definition of the Terms:
Positive (P): Observation is positive
Negative (N): Observation is not positive
True Positive (TP): Observation is positive, and is predicted to be positive.
False Negative (FN): Observation is positive, but is predicted negative.
True Negative (TN): Observation is negative, and is predicted to be negative.
False Positive (FP): Observation is negative, but is predicted positive.