Skip to contents

Uses 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 (see load_data.TransitionsLoader()).

splitting_function

Function with signature function(loader, seed, ...) that returns the list described in train_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_data and train_data_one_week (both BirdFlowR::BirdFlowIntervals()).

test_data

List with test_data and test_data_one_week (both BirdFlowR::BirdFlowIntervals()).

Examples

if (FALSE) { # \dontrun{
tl <- load_data(TransitionsLoader(trainer))
parts <-split_data(tl, seed = 42)
names(parts)
} # }