Implement a function to calculate the precision and recall of a classification model given a raw confusion matrix.