A confusion matrix is a technique that defines the performance of a classification algorithm on a set of test data for which the true values are known. The matrix uses the True Positive(TP), True Negative (TN), False Positive(FP) and False Negative(FN) to evaluate the performance.