library(tfdatasets)
data(hearts)
<- tensor_slices_dataset(hearts) %>% dataset_batch(32)
hearts
# use the formula interface
<- feature_spec(hearts, target ~ age + slope) %>%
spec step_numeric_column(age, slope) %>%
step_bucketized_column(age, boundaries = c(10, 20, 30))
<- fit(spec)
spec <- hearts %>% dataset_use_spec(spec)
dataset
<- layer_input_from_dataset(dataset) input
layer_input_from_dataset
Creates a list of inputs from a dataset
Description
Create a list ok Keras input layers that can be used together with keras::layer_dense_features()
.
Usage
layer_input_from_dataset(dataset)
Arguments
Arguments | Description |
---|---|
dataset | a TensorFlow dataset or a data.frame |
Value
a list of Keras input layers