← Back to all sparks
R

rsample

AI-ASSISTANTS
Velocity0.0

Resampling infrastructure for R modeling

tidymodels' resampling package is retiring its old splitters for sliding windows.

tidymodelsresamplingcross-validationdeprecationsr-language
Current state
rsample is at 1.3.2, a small release covering spatialsample interoperability and a soft deprecation of the lag argument on initial_time_split(). The more consequential work sits behind it: 1.3.1 added internal_calibration_split() and a calibration() accessor so tune can fit a preprocessor and a post-processor on separate parts of the analysis set, and 1.3.0 superseded rolling_origin() with the sliding_* family.
Where it's heading
Two threads run through the window. Time-based resampling is migrating from rolling_origin() to sliding_window(), sliding_index() and sliding_period(), while validation_split() and its relatives have moved from soft deprecation to warning in favour of the three-way initial_validation_split(). Alongside that, rsample is growing infrastructure other tidymodels packages consume rather than user-facing splitters.
Prediction
Given that validation_split() and friends now warn and initial_time_split()'s lag argument is soft-deprecated, the next release most likely escalates those deprecations rather than adding a resampling scheme.

Recent moves

  1. 6mo ago

    spatialsample interop and lag argument soft-deprecated

    .get_split_args() now works with spatialsample rsets without attaching the package, plus a soft deprecation of initial_time_split()'s lag argument and a docs refresh. Small maintenance on the deprecation track.

    View source ↗
  2. 1y ago

    internal_calibration_split() for post-processor fitting

    Adds internal_calibration_split() with methods across resample types, plus a calibration() accessor. This is plumbing for tune to fit preprocessor and post-processor on disjoint data, an example of rsample serving the framework rather than the end user.

    View source ↗
  3. 1y ago

    rolling_origin() superseded by the sliding_* family

    rolling_origin() is superseded by the sliding_window(), sliding_index() and sliding_period() family, and bootstrap intervals gain more flexible grouping. Three breaking changes come with it, including an error on implicit leave-one-out cross-validation.

    View source ↗
  4. 2y ago

    Fixes nested_cv() with long calls

    Two small fixes: nested_cv() no longer errors on a long outside call, and validation_set gains its own pretty() method.

    View source ↗
  5. 2y ago

    Three-way train, validation and test splits

    Introduces initial_validation_split() and its time and group variants for a genuine three-way split, with validation_set() turning the result into an rset for tuning. The older validation_split() functions begin their deprecation here.

    View source ↗
  6. 3y ago

    Stratified grouped resampling and clustering_cv()

    Stratification extends to every grouped resampling function, and clustering_cv() arrives for blocked cross-validation in arbitrary predictor spaces. bootstraps() now warns on empty assessment sets instead of staying silent.

    View source ↗