Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFeature `one_hot` argument for `step_dummy()` #145
Conversation
|
Regarding the data(okc)
okc <- okc[complete.cases(okc),]
rec <- recipe(~ diet + age + height, data = okc)
rec %>%
step_dummy(diet, one_hot = TRUE) %>%
prep(training = okc) %>%
bake(newdata = okc)I think the bit of model.matrix() that determines what to do in these cases happens at the C level, I'm not exactly sure where, but maybe this bit has something to do with it. |
It does. I added to the dummy variable vignette to mention this. |
Since I sadly deleted the PR #136 branch with
one_hot, I could not reopen it and have reimplemented it here, incorporating your comments from there.I have not removed the
contrastsargument, as I feel that is a separate feature.