Transform the dataset using the provided spec.

    Prepares the dataset to be used directly in a model.The transformed dataset is prepared to return tuples (x,y) that can be used directly in Keras.

    dataset_use_spec(dataset, spec)

    Arguments

    dataset

    A TensorFlow dataset.

    spec

    A feature specification created with feature_spec().

    Value

    A TensorFlow dataset.

    See also

    Examples

    if (FALSE) { library(tfdatasets) data(hearts) hearts <- tensor_slices_dataset(hearts) %>% dataset_batch(32) # use the formula interface spec <- feature_spec(hearts, target ~ age) %>% step_numeric_column(age) spec_fit <- fit(spec) final_dataset <- hearts %>% dataset_use_spec(spec_fit) }