Skip to content

Deprecate sklearn.extmath.log_logistic? #13509

Closed

Description

@qinhanmin2014

Maybe we can use scipy.special.expit instead, seems that it's much faster than our implementation.

Activity

  1. jnothman commented on Mar 25, 2019

    @jnothman
    Member

    The docstring of log_logistic references scipy's expit and explains that the log case isn't here for efficiency but for stability... Any reason to doubt that?

  2. qinhanmin2014 commented on Mar 25, 2019

    @qinhanmin2014
    MemberAuthor

    The docstring of log_logistic references scipy's expit and explains that the log case isn't here for efficiency but for stability... Any reason to doubt that?

    I don't think scipy's implementation is not stable. If so, maybe we should open an issue in scipy.
    And I found the following comments:
    #2882 (comment)
    #2882 (comment)

  3. jnothman commented on Mar 25, 2019

    @jnothman
    Member
  4. NicolasHug commented on Mar 25, 2019

    @NicolasHug
    Member

    It's not about the stability of expit, it's about the stability of log(expit). Basically here we avoid computing exp for big values, which might make sense. Also we avoid calling exp twice (as would be needed in expit).

    As noted above scipy's expit is only supported in new versions of scipy so we would have to write our own anyway (that's what I'm doing in #12807 ).

    If we want our implementation to be faster, we can start by cdefing the loop variables i and j, and inlining the inner function.

  5. qinhanmin2014 commented on Mar 25, 2019

    @qinhanmin2014
    MemberAuthor

    @NicolasHug

    It's not about the stability of expit, it's about the stability of log(expit).

    I can't understand what's the stability of log(expit) (will be grateful to see an example comparing our implementation and scipy)

    Basically here we avoid computing exp for big values, which might make sense. Also we avoid calling exp twice (as would be needed in expit).

    scipy also do these things?

  6. qinhanmin2014 commented on Mar 25, 2019

    @qinhanmin2014
    MemberAuthor

    Ahh, I suddenly realized that I made some foolish mistakes. @NicolasHug you're right. Apologies for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions