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

Add a first draft of stratification with groups #360

Merged
merged 8 commits into from
Aug 26, 2022
Merged

Conversation

mikemahoney218
Copy link
Member

Hi all!

Following some conversation in #317 I figured I'd post a first draft of what stratification with grouping might look like. This first draft only handles group_vfold_cv() when balance = "groups".

This version requires strata to be constant across all groups. If users have a non-constant variable they want to use for stratification, I think it makes sense to force them to create the strata (as I do in the example), because any automated binning implement will probably be non-optimal.

This implementation differs from make_strata() in that strata doesn't need to be quoted.

I'm not sure how you feel about putting the arguments after ... -- because I only added strata and pool, and didn't include breaks, nunique, or depth, I didn't want to let people pass stratification arguments by position in case those other arguments get added later.

Addresses #317

@mikemahoney218 mikemahoney218 marked this pull request as ready for review August 19, 2022 18:01
Copy link
Member

@hfrick hfrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you! 🎈 Some lines have gotten really long, could you break those up, please? I think we're good to go after that.

@mikemahoney218
Copy link
Member Author

Sounds good! I merged your pillar branch into this one to make CI work.

@hfrick hfrick merged commit 94fe634 into main Aug 26, 2022
@hfrick hfrick deleted the mike/grouped_strata branch August 26, 2022 10:34
@hfrick hfrick mentioned this pull request Aug 26, 2022
@mikemahoney218 mikemahoney218 mentioned this pull request Aug 28, 2022
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants