Skip to contents

Generalized additive models. Calls mgcv::gam() from package mgcv.

Multiclass classification is not implemented yet.

Formula

A gam formula specific to the task at hand is required for the formula parameter (see example and ?mgcv::formula.gam). Beware, if no formula is provided, a fallback formula is used that will make the gam behave like a glm (this behavior is required for the unit tests). Only features specified in the formula will be used, superseding columns with col_roles "feature" in the task.

Dictionary

This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():

Method clone()

The objects of this class are cloneable with this method.

LearnerClassifGam$clone(deep = FALSE) Arguments deep Whether to make a deep clone. Examples  # simple example t = mlr3::tsk("spam") l = mlr3::lrn("classif.gam") l$param_set$values$formula = type ~ s(george) + s(charDollar) + s(edu) + ti(george, edu)
l$train(t) l$model
#>
#> Family: binomial
#> Link function: logit
#>
#> Formula:
#> type ~ s(george) + s(charDollar) + s(edu) + ti(george, edu)
#>
#> Estimated degrees of freedom:
#> 1.00 5.42 1.00 5.05  total = 13.47
#>
#> UBRE score: -0.1759489