tidymodels / rsample

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

inner_split(): S3 method to retrive splitting arguments #491

Closed topepo closed 6 months ago

topepo commented 6 months ago

It's a bit tedious to do this:

library(tidymodels)

set.seed(19)
ad_v_fold <- vfold_cv(ad_data, v = 5, strata = Class)
ad_v_fold_attr <- attributes(ad_v_fold)[ c("v", "repeats", "strata", "breaks", "pool")]

v_fold_inner <- inner_split(ad_v_fold$splits[[1]], ad_v_fold_attr)

Created on 2024-05-23 with reprex v2.0.2

IIRC you have an internal function to do this?

simonpcouch commented 6 months ago

https://github.com/tidymodels/rsample/blob/7d35a8eb0b53ca2561818cd60bdd756badd0ac2e/R/misc.R#L298-L312

hfrick commented 6 months ago

Closing this as the helper exist :)

@topepo it's currently exported but that might change. If you find usage for it that suggests it should stay exported please comment on https://github.com/tidymodels/rsample/pull/495 🙌

github-actions[bot] commented 5 months ago

This issue 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.