Split transitions into training and test sets (S3 method)
split_data.TransitionsLoader.RdUses a splitting_function (default train_test_split()) to create
training/test splits for interval data and 1-week interval data. Returns a
list containing both training and test bundles.
Usage
# S3 method for class 'TransitionsLoader'
split_data(object, splitting_function = train_test_split, seed = NULL, ...)Arguments
- object
A
TransitionsLoader()that has been loaded (seeload_data.TransitionsLoader()).- splitting_function
Function with signature
function(loader, seed, ...)that returns the list described intrain_test_split().- seed
Optional integer to make the split reproducible.
- ...
Passed through to
splitting_function.
Value
A list with two elements:
- training_data
List with
train_dataandtrain_data_one_week(bothBirdFlowR::BirdFlowIntervals()).- test_data
List with
test_dataandtest_data_one_week(bothBirdFlowR::BirdFlowIntervals()).
Examples
if (FALSE) { # \dontrun{
tl <- load_data(TransitionsLoader(trainer))
parts <-split_data(tl, seed = 42)
names(parts)
} # }