def group_rares(data, cutoff=3):
    counts = {}
    new_data = []
    for pt in data:
        counts[pt] = counts.get(pt, 0) + 1
    for pt in data:
        if counts[pt] <= cutoff:
            new_data.append('__RARE__')
        else:
            new_data.append(pt)
    return np.array(new_data)
.. TODO:: handle test_pack['err']
dataset/ETHPy150Open theusual/kaggle-seeclickfix-ensemble/Miroslaw/data_transforms.py/group_rares--crossover with--dataset/ETHPy150Open anandology/pyjamas/test.py/PyjamasTester.print_results