FIX weird interface for compute_class_weight

Correct fix for #1746 (I think). Thanks @gatagat.