def _auc(prc):
    """Compute area under precision-recall curve.

    Parameters
    ----------
    prc : list of (confidence, precision, recall)
        Points of precision-recall (or interpolated precision-recall) curve.

    Returns
    -------
    auc : float
        Area under the precision-recall curve given by:

            sum((p[i+1] + p[i]) / 2 * (r[i+1] - r[i]))

    """
    return sum(
        (prc[i + 1][1] + prc[i][1]) / 2 * (prc[i + 1][2] - prc[i][2])
        for i in range(len(prc) - 1)
    )