Added a confusion matrix visualization and calculation function