# NOT RUN {
data(okc, package = "modeldata")
if (is_tf_available()) {
  # This may take a while: 
  rec <- 
    recipe(Class ~ age + location, data = okc) %>%
    step_feature_hash(location, num_hash = 2^6, preserve = TRUE) %>% 
    prep()
  # How many of the 135 locations ended up in each hash column?
  results <- 
    juice(rec, starts_with("location")) %>% 
    distinct() 
  apply(results %>% select(-location), 2, sum) %>% table()
}
# }
Run the code above in your browser using DataLab