Create a splits object.
Arguments
- .data
The data being passed to make a split on
- .split_type
The default is "initial_split", you can pass any other split type from the
rsample
library.- .split_args
The default is NULL in order to use the default split arguments. If you want to pass other arguments then must pass a list with the parameter name and the argument.
Details
Create a splits object that returns a list object of both the
splits object itself and the splits type. This function supports all splits
types from the rsample
package.
See also
Other Utility:
core_packages()
,
create_workflow_set()
,
fast_classification_parsnip_spec_tbl()
,
fast_regression_parsnip_spec_tbl()
,
full_internal_make_wflw()
,
install_deps()
,
load_deps()
,
match_args()
Examples
create_splits(mtcars, .split_type = "vfold_cv")
#> $splits
#> # 10-fold cross-validation
#> # A tibble: 10 × 2
#> splits id
#> <list> <chr>
#> 1 <split [28/4]> Fold01
#> 2 <split [28/4]> Fold02
#> 3 <split [29/3]> Fold03
#> 4 <split [29/3]> Fold04
#> 5 <split [29/3]> Fold05
#> 6 <split [29/3]> Fold06
#> 7 <split [29/3]> Fold07
#> 8 <split [29/3]> Fold08
#> 9 <split [29/3]> Fold09
#> 10 <split [29/3]> Fold10
#>
#> $split_type
#> [1] "vfold_cv"
#>