SL.glm: Wrapper for glm

View source: R/SL.glm.R

SL.glmR Documentation

Wrapper for glm

Description

Wrapper for generalized linear models via glm().

Note that for outcomes bounded by [0, 1] the binomial family can be used in addition to gaussian.

Usage

SL.glm(Y, X, newX, family, obsWeights, model = TRUE, ...)

Arguments

Y

Outcome variable

X

Training dataframe

newX

Test dataframe

family

Gaussian or binomial

obsWeights

Observation-level weights

model

Whether to save model.matrix of data in fit object. Set to FALSE to save memory.

...

Any remaining arguments, not used.

References

Fox, J. (2015). Applied regression analysis and generalized linear models. Sage Publications.

See Also

predict.SL.glm glm predict.glm SL.speedglm

Examples


data(Boston, package = "MASS")
Y = Boston$medv
# Remove outcome from covariate dataframe.
X = Boston[, -14]

set.seed(1)

sl = SuperLearner(Y, X, family = gaussian(),
                  SL.library = c("SL.mean", "SL.glm"))

print(sl)


SuperLearner documentation built on May 29, 2024, 5:25 a.m.