python function to check list element ratio with total data
defcompensate_imbalance(data):
total_data =len(data)
clean_data =[item for n, item inenumerate(data)if item notin data[:n]]
weight_list =[data.count(item)/total_data for item in clean_data]return weight_list