def _get_label_proportion(data_set, target):
    """Get the proportion of each type. Implemented on spark.

    Args:
        data_set (pyspark.sql.dataframe.DataFrame): The data set.
        target (str): The target column.

    Returns:
        label_proportion (dct): A dictionary, (key, values) ~ (attribute, count)
    """
    target_count = data_set.groupby(target).count()
    label_proportion = {}
    target_count = target_count.toPandas()
    for attribute, count in zip(target_count[target], target_count['count']):
        label_proportion[attribute] = count
    return label_proportion