r descr_models("gen_additive_mod", "vgam")

Tuning Parameters

There are no main tuning parameters for this model. Two relevant engine parameters are:

Translation from parsnip to the original package

r uses_extension("gen_additive_mod", "vgam", "classification")

library(ordered)

gen_additive_mod() %>% 
  set_engine("vgam") %>% 
  set_mode("classification") %>% 
  translate()

Model fitting

This model should be used with a model formula so that smooth terms can be specified. For example:

#| eval: false
library(VGAM)
# Make number of cylinders and ordered factor
ord_cars <- mtcars[, -1]
ord_cars$cyl <- as.ordered(ord_cars$cyl)

car_fit <- 
  gen_additive_mod() |> 
  set_engine("vgam") |> 
  set_mode("classification") |> 
  fit(cyl ~ disp + s(wt) + am, data = ord_cars)

The smoothness of the terms will need to be manually specified (e.g., using s(x, df = 10)) in the formula.

When using a workflow, pass the model formula to [workflows::add_model()]'s formula argument, and a simplified preprocessing formula elsewhere.

#| eval: false
spec <- 
  gen_additive_mod() |> 
  set_engine("vgam") |> 
  set_mode("classification")

workflow() |> 
  add_model(spec, formula = cyl ~ disp + s(wt) + am) |> 
  add_formula(cyl ~ disp + wt + am) |> 
  fit(data = ord_cars) |> 
  extract_fit_engine()

To learn more about the differences between these formulas, see [?model_formula][parsnip::model_formula].

Preprocessing requirements

#| child: template-makes-dummies.Rmd

Case weights

#| child: template-uses-case-weights.Rmd

Prediction types

#| label: predict-types

parsnip:::get_from_env("gen_additive_mod_predict") |>
  dplyr::filter(engine == "vgam") |> 
  dplyr::select(mode, type)

References



Try the parsnip package in your browser

Any scripts or data that you put into this service are public.

parsnip documentation built on May 14, 2026, 5:08 p.m.