tidymodels / rsample

Classes and functions to create and summarize resampling objects
https://rsample.tidymodels.org
Other
341 stars 66 forks source link

Allow explicit specification of `strata = NULL` for grouped resampling #486

Closed hfrick closed 6 months ago

hfrick commented 6 months ago

closes #485

library(rsample)

set.seed(11)
rs1 <- group_vfold_cv(warpbreaks, "tension")

rs1 <- group_vfold_cv(warpbreaks, "tension", strata = NULL)

Created on 2024-05-22 with reprex v2.1.0

hfrick commented 6 months ago

yeah... just doing that switch breaks being able to supply an unquote name for strata. I think it would need to be evaluated for this condition but unevaluated for check_grouped_strata() and that looked like the worse effort/effect ratio than what I did there.

I have since noticed that I was not alone in going down this route: https://github.com/tidymodels/rsample/pull/100

If we're touching this, we should do it across rsample.

github-actions[bot] commented 5 months ago

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.