from typing import Counter


def count_classes(y):
    """
    Returns a dictionary with class balances for each class (absolute and relative)
    :param y: gold labels as array of int
    """
    count_dict = Counter([l for l in y])
    return {l: str(c) + " ({0:.2f}".format((c / len(y)) * 100) + "%)" for l, c in count_dict.items()}