Made plot.weight.classes generic