Build a precision-recall curve and compute average precision from ranked binary-classification scores.