Update function to create confusion matrix