Prepare a dataset for analysis
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)
Arguments
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. |
Value
A dataset. The dataset will have a structure of either:
When
named_features
isTRUE
:list(x = list(feature_name = feature_values, ...), y = response_values)
When
named_features
isFALSE
:list(x = features_array, y = response_values)
, wherefeatures_array
is a Rank 2 array of(batch_size, num_features)
.
Note that the y
element will be omitted when y
is NULL
.
See also
input_fn() for use with tfestimators.