[MRG] FIX for exception thrown when y does not have all classes

This is a fix for #3581
Maybe

```python
y_freq = np.bincount(y_ind, minlength=n_classes)
np.where(y_freq != 0, 1. / np.maximum(1, y_freq), 0)
```

with the comment I suggested? Not sure if that makes the mean come out right, it would seem like the weighting function is actually undefined when not all classes are present.

An alternative is to do additive smoothing (`y_freq += alpha` for some small value of `alpha`), but that would change the current behavior...