Skip to content

using sklearn.metrics.normalized_mutual_info_score for continuous data does not return a warning #17892

Closed

Description

I have been informed that using sklearn.metrics.normalized_mutual_info_score to estimate a normalized mutual information score on continuous data should have returned at least a warning that this module is for use only on discrete data; and error on floats.

an example of test data:

noise=np.random.rand(500)
wavelength=np.linspace(0.01,1,500)*1e-6

# testing the normalized MI score between wavelength and noise - should return near zero for totally unrelated data sets
constant_normalized_mi=normalized_mutual_info_score(wavelength,noise)

output:
1.0

Activity

  1. added
    Easy
    good first issue
    on Jul 11, 2020
  2. amueller commented on Jul 11, 2020

    @amueller
    Member

    I think the check_clustering function should call type_of_target. We're doing that in the classification metrics. I think this has come up before, I think there's something in the issue tracker about that already.

  3. dachosen1 commented on Jul 11, 2020

    @dachosen1
    Contributor

    I can take this.

  4. dachosen1 commented on Jul 11, 2020

    @dachosen1
    Contributor

    I've implemented the change for check_clustering to raise an error for a float. In the example that @bfiranski can you confirm whether the function should produce an error or a near zero value.

  5. Ashutosh619-sudo commented on Jul 19, 2020

    @Ashutosh619-sudo

    #17938
    can you please update me on this.

  6. dachosen1 commented on Jul 20, 2020

    @dachosen1
    Contributor

    I fixed this issue. From my understanding the fix is suppose to return a warning not a error.

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

    Easygood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions