Skip to content

flip_y in make_classification is misleading #14088

Closed

Description

@mhviraf

As per description of flip_y, it is "The fraction of samples whose class are randomly exchanged."
So when you have two classes one would expect by setting flip_y equal to 0.1, 10% of the labels flip (exchange), as the name suggest (flip_y). However, if you look at the source code 10% of the labels are assigned random labels which 50% of the time they are assigned their own labels so about 5% of labels are going to be flipped in the end.

This doesn't seem like a big issue at first, but we have had so many people confused with flip_y in a competition on Kaggle at https://www.kaggle.com/c/instant-gratification.

Activity

  1. jnothman commented on Jun 14, 2019

    @jnothman
    Member
  2. kesshijordan commented on Nov 2, 2019

    @kesshijordan
    Contributor

    working on this with @akeshavan at wimlds sklearn sprint

  3. kesshijordan commented on Nov 2, 2019

    @kesshijordan
    Contributor

    The variable name, itself, is also misleading since it implies that the label gets "flipped", not set randomly, but changing the variable name will cause problems with backwards compatibility. Is it adequate to change the description of the variable and keep the variable name flip_y constant, or is changing the variable name to something like random_fraction an option?

  4. akeshavan commented on Nov 2, 2019

    @akeshavan
    Contributor

    The current description is: "The fraction of samples whose class are randomly exchanged. Larger
    values introduce noise in the labels and make the classification
    task harder."

    We are suggesting: "The fraction of samples whose class is assigned randomly. Larger
    values introduce noise in the labels and make the classification
    task harder."

    Any other suggestions?

  5. TomDLT commented on Nov 2, 2019

    @TomDLT
    Member

    Is it adequate to change the description of the variable and keep the variable name flip_y constant, or is changing the variable name to something like random_fraction an option?

    I think we would prefer not changing the variable name, and just improve the documentation.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions