A confusion matrix is a summary of classification problem prediction results. 
The number of correct and incorrect predictions is summarized using count values and divided by class.

The function takes two arrays of same length and returns a list of four metrics i.e., TN, FP, FN, and TP
By using confusion matrix we can calculate precision, recall, f1 score, FDR and accuracy.