Skip to content

Instantly share code, notes, and snippets.

@topepo
Created March 28, 2020 17:57
Show Gist options
  • Save topepo/3157fed1b7c975806cd77ede4633b641 to your computer and use it in GitHub Desktop.
Save topepo/3157fed1b7c975806cd77ede4633b641 to your computer and use it in GitHub Desktop.
library(tidymodels)
library(modeldata)
data(attrition)
ord_rec <-
recipe(Attrition ~ JobInvolvement + JobSatisfaction, data = attrition) %>%
step_dummy(all_nominal()) %>%
prep() %>%
juice() %>%
slice(1:10)
unord_rec <-
recipe(Attrition ~ JobInvolvement + JobSatisfaction, data = attrition) %>%
step_unorder(all_nominal(), -all_outcomes()) %>%
step_dummy(all_nominal(), -all_outcomes()) %>%
prep() %>%
juice() %>%
slice(1:10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment