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

This is a fix for #3581
That sounds pretty good though that might give weird results for the ```np.mean(recip_freq)``` which is calculated a little later. Perhaps we could do something like this:
```
recip_freq[np.nonzero(recip_freq)] = 1. / recip_freq[np.nonzero(recip_freq)]
```
This will give a weight 0 for unused weights.