Computing predictive accuracy and confusion matrices