Skip to content

Comparing string to array in _estimate_mi #13481

Closed

Description

@amueller

In _estimate_mi there is discrete_features == 'auto' but discrete features can be an array of indices or a boolean mask.
This will error in future versions of numpy.
Also this means we never test this function with discrete features != 'auto', it seems?

Activity

  1. added
    Easy
    good first issue
    on Mar 20, 2019
  2. hermidalc commented on Mar 20, 2019

    @hermidalc
    Contributor

    I'll take this

  3. amueller commented on Mar 21, 2019

    @amueller
    MemberAuthor

    @hermidalc go for it :)

  4. punkstar25 commented on Mar 21, 2019

    @punkstar25

    i'm not sure ,but i think user will change the default value if it seem to be array or boolean mask....bcz auto is default value it is not fixed.

  5. jnothman commented on Mar 21, 2019

    @jnothman
    Member

    I haven't understood, @punkstar25

  6. MohammedKhandwawala commented on Mar 26, 2019

    @MohammedKhandwawala

    @amueller i want to take this issue. I am a beginner.
    Also can you elaborate this
    "Also this means we never test this function with discrete features != 'auto', it seems?"
    What should it return if discrete features is a string and not "auto"

  7. NicolasHug commented on Mar 26, 2019

    @NicolasHug
    Member

    @MohammedKhandwawala , I'm afraid @hermidalc has already opened #13497 to address this.

  8. hermidalc commented on Mar 26, 2019

    @hermidalc
    Contributor

    @amueller i want to take this issue. I am a beginner.
    Also can you elaborate this
    "Also this means we never test this function with discrete features != 'auto', it seems?"
    What should it return if discrete features is a string and not "auto"

    @MohammedKhandwawala I have a pull request open and am finishing this issue. To answer your question what I believe @amueller meant is to properly test and if necessary raise an exception for discrete_features string cases not equal to 'auto' as well as other invalid parameter values. The updated if/elif statements in the pull request should fix that as well as checking for a str instance before testing == 'auto' which would fail if a numpy array in future versions of numpy.

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

    BugEasygood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions