def _get_rank_stats(results):
    """
    Helper function that produces median and m.a.d
    probabilities for each of 2 classes given _cv_proba 
    results with reworked columns.
    """
    grouped = results[['class', 'proba']].groupby(['class']).median().rename(
        columns={'proba': 'median'})
    return grouped.join(results[['class', 'proba']].groupby(['class']).mad(
        ).rename(columns={'proba': 'mad'}))
