r"""Compute the specifity that a particular threshold on the scores can acheive
    specificity = Num_True_Negative / (Num_True_Negative + Num_False_Positive)
    >>> scores = np.arange(0, 1, 0.1)
    >>> spec_from_thresh(0.5, labels=(scores > .5).astype(int), scores=scores)
    1.0
    >>> spec_from_thresh(0.5, labels=(scores > .4).astype(int), scores=scores)
    1.0
    >>> spec_from_thresh(0.5, labels=(scores > .9).astype(int), scores=scores)
    0.6

def spec_from_thresh(thresh, labels, scores, *args, **kwargs):
    r"""Compute the specifity that a particular threshold on the scores can acheive
    specificity = Num_True_Negative / (Num_True_Negative + Num_False_Positive)
    >>> scores = np.arange(0, 1, 0.1)
    >>> spec_from_thresh(0.5, labels=(scores > .5).astype(int), scores=scores)
    1.0
    >>> spec_from_thresh(0.5, labels=(scores > .4).astype(int), scores=scores)
    1.0
    >>> spec_from_thresh(0.5, labels=(scores > .9).astype(int), scores=scores)
    0.6
    """
    df = pd.DataFrame(list(zip(labels, np.array(scores > thresh).astype(int))))
    c = Confusion(df, *args, **kwargs)
    return c._binary_specificity