BUG fix compute_class_weights issue in SGD

Fixes #1749.

This isn't for review, I just want to see if Travis succeeds this time.

My humble apologies for leaving `master` in a broken state for two days. I'll be more careful in the future.