split_dataset {keras3} | R Documentation |
Splits a dataset into a left half and a right half (e.g. train / test).
Description
Splits a dataset into a left half and a right half (e.g. train / test).
Usage
split_dataset(
dataset,
left_size = NULL,
right_size = NULL,
shuffle = FALSE,
seed = NULL
)
Arguments
dataset |
A |
left_size |
If float (in the range |
right_size |
If float (in the range |
shuffle |
Boolean, whether to shuffle the data before splitting it. |
seed |
A random seed for shuffling. |
Value
A list of two tf$data$Dataset
objects:
the left and right splits.
Examples
data <- random_uniform(c(1000, 4)) c(left_ds, right_ds) %<-% split_dataset(list(data$numpy()), left_size = 0.8) left_ds$cardinality()
## tf.Tensor(800, shape=(), dtype=int64)
right_ds$cardinality()
## tf.Tensor(200, shape=(), dtype=int64)
See Also
Other dataset utils:
audio_dataset_from_directory()
image_dataset_from_directory()
text_dataset_from_directory()
timeseries_dataset_from_array()
Other utils:
audio_dataset_from_directory()
clear_session()
config_disable_interactive_logging()
config_disable_traceback_filtering()
config_enable_interactive_logging()
config_enable_traceback_filtering()
config_is_interactive_logging_enabled()
config_is_traceback_filtering_enabled()
get_file()
get_source_inputs()
image_array_save()
image_dataset_from_directory()
image_from_array()
image_load()
image_smart_resize()
image_to_array()
layer_feature_space()
normalize()
pad_sequences()
set_random_seed()
text_dataset_from_directory()
timeseries_dataset_from_array()
to_categorical()
zip_lists()