-
Notifications
You must be signed in to change notification settings - Fork 88
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
Divert linear regressions with poisson family to poisson_reg() #1219
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! For your consideration but not a request: Would it make sense to move those checks to check_args.linear_reg()
or would checks on engine args in addition to main args mess with anything else?
expect_snapshot( | ||
linear_reg(penalty = 1) %>% | ||
set_engine("glmnet", family = poisson) %>% | ||
translate(), | ||
error = TRUE | ||
) | ||
expect_snapshot( | ||
linear_reg(penalty = 1) %>% | ||
set_engine("glmnet", family = stats::poisson) %>% | ||
translate(), | ||
error = TRUE | ||
) | ||
expect_snapshot( | ||
linear_reg(penalty = 1) %>% | ||
set_engine("glmnet", family = stats::poisson()) %>% | ||
translate(), | ||
error = TRUE | ||
) | ||
expect_snapshot( | ||
linear_reg(penalty = 1) %>% | ||
set_engine("glmnet", family = "poisson") %>% | ||
translate(), | ||
error = TRUE | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the clarity of these tests
Motivated by tidymodels/tune#956
There are so many ways people can pass the family to
glm()
andglmnet()
. This checks for all four methods that I'm aware of.