tidymodels / tidymodels/rsample

`inner_split()`: global prop argument

Open
#493 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
R
Stars
343
Forks
67
Avg merge
1h 9m
Merged PRs (30d)
2

Description

I've read #487...

Not certain yet but I feel like we will want users to be able to do something different from what the original split does.

If that's the case, I propose a global prop argument

inner_split <- function(x, ..., prop = NULL) {
  UseMethod("inner_split")
}

Global because some of the splitting arguments in each method has an argument with the same name. With one or two exceptions, the inner split can emulate the original scheme but hold more or less back (proportionally).

So let's save that we start with obj <- mc_cv(data, prop = 3/4) but we only want to give 10% to the potato calibration set. Irrespective or the original prop value in split_args, the global prop would take over with

inner_split(obj, split_args = list(prop = 3/4), prop = 0.1) 
# or just leave the list value out since it is not used

prop can be used with bootstrap, times series, and other types of splits too (except clustering)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the inner_split() entry point and review how split_args is handled for mc_cv(), bootstrap, time-series, and other split types. Determine whether a global prop should override the original split proportion consistently, while preserving the stated clustering exception. Done means the behavior and scope are settled across the supported split methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.