Added code to compute the confusion matrix and output it to a csv file.