View source: R/dataset_methods.R
dataset_prepare | R Documentation |
Transform a dataset with named columns into a list with features (x
) and
response (y
) elements.
dataset_prepare(
dataset,
x,
y = NULL,
named = TRUE,
named_features = FALSE,
parallel_records = NULL,
batch_size = NULL,
num_parallel_batches = NULL,
drop_remainder = FALSE
)
dataset |
A dataset |
x |
Features to include. When |
y |
(Optional). Response variable. |
named |
|
named_features |
|
parallel_records |
(Optional) An integer, representing the number of records to decode in parallel. If not specified, records will be processed sequentially. |
batch_size |
(Optional). Batch size if you would like to fuse the
|
num_parallel_batches |
(Optional) An integer, representing the number of batches to create in parallel. On one hand, higher values can help mitigate the effect of stragglers. On the other hand, higher values can increase contention if CPU is scarce. |
drop_remainder |
(Optional.) A boolean, representing whether the last
batch should be dropped in the case it has fewer than |
A dataset. The dataset will have a structure of either:
When named_features
is TRUE
: list(x = list(feature_name = feature_values, ...), y = response_values)
When named_features
is FALSE
: list(x = features_array, y = response_values)
,
where features_array
is a Rank 2 array of (batch_size, num_features)
.
Note that the y
element will be omitted when y
is NULL
.
input_fn() for use with tfestimators.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.