Skip to content
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

More details of formula usage in mgcv engine docs when using workflow #770

Open
qiushiyan opened this issue Jul 15, 2022 · 1 comment
Open

Comments

@qiushiyan
Copy link
Contributor

@qiushiyan qiushiyan commented Jul 15, 2022

We need to include more details about using gam formula in the engine docgen_additive_mod(engien = "mgcv"). The engine doc only shows model fitting examples when using gam formula in fit() directly. When using a workflow with recipes, the gam formula needs to be declared in add_model alongside with the model spec

# no inline function in recipe
rec <- recipe(formula = mpg ~ ., data = mtcars)
spec <- gen_additive_mod() %>% 
    set_engine("mgcv")

wf <- workflow() %>% 
    add_recipe(rec) %>%  
    add_model(spec, formula = mpg ~ wt + gear + cyl + s(disp, k = 10))  # use gam formula here
@simonpcouch
Copy link
Contributor

@simonpcouch simonpcouch commented Jul 26, 2022

A relevant Community post with reprex: https://community.rstudio.com/t/error-in-fit-xy-with-gam-model/143065

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants