tidymodels / tidymodels/rsample
Add random seed argument to resampling functions
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 343
- Forks
- 67
- Avg merge
- 1h 9m
- Merged PRs (30d)
- 2
Description
Instead of having to set the random seed outside of calls to create resample objects, it would be helpful to a allow passing the seed as an argument. This would help with reproducibility as the seed would be part of the function and could even be preserved as an attribute in an rset object.
For example, something like this:
resample_function(<current arguments>, seed = NULL){
if(!is.null(seed) && is.numeric(seed)) set.seed(seed)
...
}
The default would still allow setting the seed outside the function as currently supported. It would act similar to sklearn's random_state argument.
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 by reviewing the resampling functions and their current seed-handling behavior. Determine the scope of functions affected, then verify that an optional seed supports reproducible resampling while preserving existing external seeding and can be retained on an rset object.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100