[scikit-learn] Sparse predict_proba and Fenchel-Young losses

Sean Violante sean.violante at gmail.com
Fri Oct 26 11:06:15 EDT 2018


1) You can call fit(X, Y) where Y is a n_samples array of label integers
*or* Y is a n_samples x n_classes array containing *label proportions*.

Matthieu - that's great.  In glmnet it is implemented directly as counts
(not proportions) - which may be more natural.

I find it a shame this is not implemented in sklearn - if ever sample
weights is properly added to sklearn (eg for testing) it would be great to
handle this as well.  For me the use case is grouped data (for memory
efficiency) - where this comes naturally.

it would then benefit to add a crossvalidation that 'ignored grouping' ie
replicating sampling uniformly from ungrouped data.

On Thu, Oct 25, 2018 at 6:27 PM Andreas Mueller <t3kcit at gmail.com> wrote:

> Awesome!
>
> On 10/23/18 9:10 AM, Mathieu Blondel wrote:
>
> Hi,
>
> Most scikit-learn users who need predict_proba use the logistic regression
> class. We've released a new package implementing more loss functions useful
> for probabilistic classification.
>
> https://github.com/mblondel/fenchel-young-losses/
>
> This is based on our recently proposed family of loss functions called
> "Fenchel-Young losses" [*].
>
> Two distinguishing features that should be of interest:
>
> 1) You can call fit(X, Y) where Y is a n_samples array of label integers
> *or* Y is a n_samples x n_classes array containing *label proportions*.
>
> We've gotten that feature request for logistic regression a couple of
> times, not sure it's in the scope of scikit-learn.
> Great to see that you've done it!
>
>
> 2) predict_proba(X) is able to output *sparse* probabilities for some
> choices of loss functions (loss="sparsemax" or loss="tsallis"). This means
> that some classes may get *exactly* zero probability.
>
> Both features are especially useful in a multi-label setting.
>
> We've also released drop-in replacements for PyTorch and Tensorflow loss
> functions in the same package.
>
> Feedback welcome!
>
> Cheers,
> Mathieu
>
> [*] https://arxiv.org/abs/1805.09717
>
> _______________________________________________
> scikit-learn mailing listscikit-learn at python.orghttps://mail.python.org/mailman/listinfo/scikit-learn
>
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20181026/4bde8a65/attachment-0001.html>


More information about the scikit-learn mailing list