[MRG] Implements Multiclass hinge loss

Implements multiclass hinge loss. Fixes #3451 
That's fine.

On 21 September 2014 23:41, Saurabh Jha <notifications@github.com> wrote:

>  In sklearn/metrics/classification.py:
>
> > -    lbin = LabelBinarizer(neg_label=-1)
> > -    y_true = lbin.fit_transform(y_true)[:, 0]
> > -
> > -    if len(lbin.classes_) > 2 or (pred_decision.ndim == 2
> > -                                  and pred_decision.shape[1] != 1):
> > -        raise ValueError("Multi-class hinge loss not supported")
> > -    pred_decision = np.ravel(pred_decision)
> > -
> > -    try:
> > -        margin = y_true * pred_decision
> > -    except TypeError:
> > -        raise TypeError("pred_decision should be an array of floats.")
> > +
> > +    y_lab = np.unique(y_true)
> > +    if len(y_lab) > 2:
> > +        if labels is None and len(
>
> Oh okay. So I pushed in the new commit. Do you like this indentation or
> should I switch to your second one?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/scikit-learn/scikit-learn/pull/3607/files#r17825352>.
>