-
Notifications
You must be signed in to change notification settings - Fork 92
Add argument for one hot encoding to parsnip #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Ah actually, I just realized I may have our plan not laid out in my head clearly. parsnip does not depend on hardhat at all right now. Let's chat more about the plan for, for example, |
Closes #326 |
After doing some tests, I think that the glmnet models should be changed to the traditional indicator scheme. My recollection about this was half right - while an intercept is not created with the other coefficients (or regularized), one is calculated after parameter estimation. I did some sanity checking with a simple model containing a single factor predictor. Doing a one-hot encoding would results in incorrect and inaccurate parameters (unless I"ll update the PR to change those back. Also, I thought that we were going to do one-hot for |
The latest version here only handles the "traditional" indicators when going to indicators <- indicators == "traditional" I'm leaving this as draft because we need to still handle the one hot case, with different contrasts and all that. The current results of library(parsnip)
c("boost_tree",
"decision_tree",
"linear_reg",
"logistic_reg",
"mars",
"mlp",
"multinom_reg",
"nearest_neighbor",
"null_model",
"rand_forest",
"surv_reg",
"svm_poly",
"svm_rbf") %>%
purrr::map_dfr(get_encoding) %>%
knitr::kable()
Created on 2020-06-26 by the reprex package (v0.3.0.9001) |
Co-authored-by: Julia Silge <[email protected]>
Co-authored-by: Julia Silge <[email protected]>
Co-authored-by: Julia Silge <[email protected]>
Co-authored-by: Julia Silge <[email protected]>
Co-authored-by: Julia Silge <[email protected]>
Co-authored-by: Julia Silge <[email protected]>
Co-authored-by: Julia Silge <[email protected]>
Co-authored-by: Julia Silge <[email protected]>
Co-authored-by: Julia Silge <[email protected]>
Co-authored-by: Julia Silge <[email protected]>
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
This PR connects tidymodels/hardhat#140 to parsnip, with
one_hot
as an encoding option in registering a model.Created on 2020-06-18 by the reprex package (v0.3.0.9001)
I have not yet worked on any changes to
form_xy()
orconvert_form_to_xy_fit()
to use theone_hot
argument. I believeconvert_form_to_xy_fit()
will need to use some of the new hardhat work, like contrasts, etc.