Handle degenerate cases in precision/recall and AUC correctly