sklearn_utils/utils/data_utils.py
def average_by_label(X, y, ref_label):
    '''
    Calculates average dictinary from list of dictionary for give label

    :param List[Dict] X: dataset
    :param list y: labels
    :param ref_label: reference label
    '''
    # TODO: consider to delete defaultdict
    return defaultdict(float,
                       pd.DataFrame.from_records(
                           filter_by_label(X, y, ref_label)[0]
                       ).mean().to_dict())
def average_by_label(X, y, ref_label):
    '''
    Calculates average dictinary from list of dictionary for give label

    :param List[Dict] X: dataset
    :param list y: labels
    :param ref_label: reference label
    '''
    # TODO: consider to delete defaultdict
    return defaultdict(float,
                       pd.DataFrame.from_records(
                           filter_by_label(X, y, ref_label)[0]
                       ).mean().to_dict())
Calculates average dictinary from list of dictionary for give label

    :param List[Dict] X: dataset
    :param list y: labels
    :param ref_label: reference label