[MRG] update sklearn.svm.bounds to use recent helpers

Here was some code with stale conventions. If it is useful code, perhaps it should be available in `linear_model` (and for alpha), not just in `svm`.
Is the correct error that "The classes are inseparable"?


On 17 August 2014 00:23, Vlad Niculae <notifications@github.com> wrote:

>  In sklearn/svm/bounds.py:
>
> > -    classes = np.unique(y)
> > -    n_classes = np.size(classes)
> > -    if n_classes <= 2:
> > -        c = classes[0]
> > -        y = y.reshape((1, -1))
> > -        _y = np.empty(y.shape)
> > -        _y[y == c] = 1
> > -        _y[y != c] = -1
> > -    else:
> > -        _y = np.empty((n_classes, np.size(y)))
> > -        for i, c in enumerate(classes):
> > -            _y[i, y == c] = 1
> > -            _y[i, y != c] = -1
> > -
> > -    den = np.max(np.abs(dot(_y, X)))
> > +        den = max(den, abs(np.dot(Y, bias)).max())
> >
> >      if den == 0.0:
> >          raise ValueError('Ill-posed l1_min_c calculation')
>
> Could this error message be made more informative? Would it make sense to
> return np.inf in this case, since it seems that you'd always learn a null
> model with any C?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/scikit-learn/scikit-learn/pull/3564/files#r16325002>.
>