tidymodels / tidymodels/rsample
document algorithm in group_vfold_cv
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 343
- Forks
- 67
- Avg merge
- 1h 9m
- Merged PRs (30d)
- 2
Description
I expected some description of the underlying algorithm on ?group_vfold_cv.
In particular I wonder how the assignment works when you specify group, strata, and balance="observations".
Currently I see:
group: A variable in 'data' (single character or name) used for
grouping observations with the same value to either the
analysis or assessment set within a fold.
…
balance: If 'v' is less than the number of unique groups, how should
groups be combined into folds? Should be one of '"groups"',
which will assign roughly the same number of groups to each
fold, or '"observations"', which will assign roughly the same
number of observations to each fold.
…
strata: A variable in 'data' (single character or name) used to
conduct stratified sampling. When not 'NULL', each resample
is created within the stratification variable. Numeric
'strata' are binned into quartiles.
Can you please explain what algorithm is used to assign "roughly the same number of observations to each fold" ?
And can you please clarify, is it
- roughly the same number of overall observations? or
- roughly the same number of observations per stratum?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the ?group_vfold_cv entry point and review the current descriptions of group, strata, and balance. Trace the assignment behavior needed to explain how groups are allocated with balance="observations" and strata, including whether balancing applies overall or within each stratum. Done means the documentation clearly describes the algorithm and answers both questions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100