def _calc_predictability(allowable_designs, threshold):
    """calculate how many designes are classified as predictable for a given
    threshold on 'p_chose_B' """
    highly_predictable = (allowable_designs['p_chose_B'] < threshold) | (
        allowable_designs['p_chose_B'] > 1 - threshold)
    n_predictable = sum(highly_predictable)
    n_not_predictable = allowable_designs.shape[0] - n_predictable
    return highly_predictable, n_predictable, n_not_predictable
