ENH use bincount in compute_class_weight

As suggested by @amueller.