[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`.
Sounds a bit more detailed than necessary. I've committed "Ill-posed
l1_min_c calculation: l1 will always select zero coefficients for this data"


On 18 August 2014 23:04, 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')
>
> It seems that in such cases you'll always get zero coefs, so maybe the
> error message can specify this.
>
> "'Ill-posed l1_min_c calculation. There is no value of C for which a
> l1-regularized LinearSVC or LogisticRegression will have non-zero
> coefficients."
>
> What do you think?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/scikit-learn/scikit-learn/pull/3564/files#r16351299>.
>