partition: Split a dataset into training and held-out test partitions
Description
Splits dat by the rule in a PartitionConfig and returns a manifest of
the split, including a DataFingerprint of the source and of each
partition. With outdir, writes training.parquet and test.parquet,
which a SuperConfig references through dat_training_path and
dat_test_path.
Named list: the partition manifest -- config, source (a
DataFingerprint of dat), and outputs (a list with training and
test, each holding a fingerprint and, when outdir is given, the path
written to).
Arguments
dat
data.frame or data.table: The dataset to split.
config
PartitionConfig: The split rule.
outdir
Optional Character: Directory to write training.parquet and
test.parquet to; created if it does not exist. If NULL, nothing is
written and each outputs entry carries its fingerprint and row count
without a path.
overwrite
Logical: If TRUE, overwrite existing output files.