📅  最后修改于: 2022-03-11 14:45:17.070000             🧑  作者: Mango
def compensate_imbalance(data):
total_data = len(data)
clean_data = [item for n, item in enumerate(data) if item not in data[:n]]
weight_list = [data.count(item)/total_data for item in clean_data]
return weight_list