tidymodels / rsample

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

`inner_split()`: keep everything inside of `split_args` or not? #487

Open hfrick opened 4 months ago

hfrick commented 4 months ago

Should we disambiguate split_args—the arguments supplied to the function that generated the object—and additional arguments—in this case, prop—in the function signature?

_Originally posted by @simonpcouch in https://github.com/tidymodels/rsample/pull/483#discussion_r1610056711_

hfrick commented 4 months ago

More from Simon:

I guess what I'm suggesting is that the answer to this comment is "yes" and we'd call inner_split() from tune/workflows as:

  split_args <- get_split_args(r_set)
  r_split <- get_rsplit(r_set, 1)

  # ...where prop is extracted from `add_tailer(prop)`
  isplit <- inner_split(r_split, split_args, prop = .8)

rather than:

  split_args <- get_split_args(r_set)
  r_split <- get_rsplit(r_set, 1)
  # since the r_set doesn't know where the supplied data comes from (or whether
  # it was generated by `initial_split()` or friends)
  split_args$prop <- .8

  isplit <- inner_split(r_split, split_args)