finalize confusion matrix