Skip to content

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

Description

@qiushiyan

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions