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
The text was updated successfully, but these errors were encountered:
We need to include more details about using gam formula in the engine doc
gen_additive_mod(engien = "mgcv"). The engine doc only shows model fitting examples when using gam formula infit()directly. When using a workflow with recipes, the gam formula needs to be declared inadd_modelalongside with the model specThe text was updated successfully, but these errors were encountered: