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, normalizer_fn = scaler_standard()) %>%
step_bucketized_column(age, boundaries = c(20, 50)) %>%
step_remove_column(age)
spec_fit <- fit(spec)
final_dataset <- hearts %>% dataset_use_spec(spec_fit)
}
Run the code above in your browser using DataLab