Learn R Programming

rtemis (version 1.4.3)

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.

Usage

partition(dat, config, outdir = NULL, overwrite = FALSE, verbosity = 1L)

Value

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.

verbosity

Integer: Verbosity level.

Author

EDG

Examples

Run this code
partition(iris, setup_RandomPartition(train_p = 0.8, seed = 2026L))

Run the code above in your browser using DataLab