Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split plot refinement (accurate labeling) #876

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tbohne
Copy link

@tbohne tbohne commented Jan 17, 2024

I used get_splits(train_labels, valid_size=.2, stratify=True, random_state=23, shuffle=True).
In this case, I would expect the second label to be "Valid" instead of "Test". I'm not specifying any test split and by default it is zero. I am, however, specifying a valid_size, which is why the labels should be "Train" and "Validation", not "Test", but it looks like this:
image

I made a small change to plot_splits() to change the behavior to my needs. For some reason, it assumed that one split, i.e., two lists, always means (train, test). I realized that validation data is not optional in the split generation function, so I assumed it as mandatory. So the combination of only "Train" and "Test" is not possible.

Behavior now:

  • specify valid_size and test_size -> three lists and labels "Train", "Valid" and "Test":
  • image
  • specify valid_size -> two lists and labels "Train" and "Valid":
  • image
  • specify test_size -> three lists and labels "Train", "Valid" and "Test" (since valid data is mandatory):
  • image
  • specify test_size and set valid_size to 0 -> two lists and labels "Valid" and "Test" (in this case valid == train):
  • image

This is a reasonable labeling behavior in my opinion (under the assumption that validation data is mandatory).
I also set a default value for the new parameter in plot_splits() so that it doesn't cause any compatibility issues.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant