Learn R Programming

tfdatasets (version 1.9)

sample_from_datasets: Samples elements at random from the datasets in datasets.

Description

Samples elements at random from the datasets in datasets.

Usage

sample_from_datasets(datasets, weights = NULL, seed = NULL)

Arguments

datasets

A list ofobjects with compatible structure.

weights

(Optional.) A list of length(datasets) floating-point values where weights[[i]] represents the probability with which an element should be sampled from datasets[[i]], or a dataset object where each element is such a list. Defaults to a uniform distribution across datasets.

[[i]: R:[i [[i]: R:[i

seed

(Optional.) An integer, representing the random seed that will be used to create the distribution.

Value

A dataset that interleaves elements from datasets at random, according to weights if provided, otherwise with uniform probability.