Creates a feature specification.

    Used to create initialize a feature columns specification.

    feature_spec(dataset, x, y = NULL)

    Arguments

    dataset

    A TensorFlow dataset.

    x

    Features to include can use tidyselect::select_helpers() or a formula.

    y

    (Optional) The response variable. Can also be specified using a formula in the x argument.

    Value

    a FeatureSpec object.

    Details

    After creating the feature_spec object you can add steps using the step functions.

    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 ~ .) # select using `tidyselect` helpers spec <- feature_spec(hearts, x = c(thal, age), y = target) }