Train/test split helper for transitions
train_test_split.RdCreates a random 70/30 split of interval transitions and one-week transitions,
with optional downsampling of the training set to a fixed number of transitions
(useful for learning-curve experiments). Returns four
BirdFlowR::BirdFlowIntervals() objects grouped into training/test lists.
Arguments
- loader
A loaded
TransitionsLoader()(contains$transitions).- seed
Optional integer for reproducibility (
set.seed()).- training_n_transitions
Optional integer. If supplied, subsamples the training intervals to exactly this number (errors if insufficient data).
Value
A list:
- training_data
List with
train_data,train_data_one_week.- test_data
List with
test_data,test_data_one_week.
Examples
if (FALSE) { # \dontrun{
tl <- load_data(TransitionsLoader(trainer))
parts <- train_test_split(tl, seed = 1, training_n_transitions = 1000)
} # }