Skip to contents

A wrapper for glmnet::glmnet() for use in nadir::super_learner().

Usage

lnr_glmnet(data, formula, lambda = 0.2, ...)

Arguments

data

A dataframe to train a learner / learners on.

formula

A regression formula to use inside this learner.

lambda

The multiplier parameter for the penalty; see ?glmnet::glmnet

...

Any extra arguments that should be passed to the internal model for model fitting purposes.

Value

A prediction function that accepts newdata, which returns predictions (a numeric vector of values, one for each row of newdata).

Details

glmnet predictions will by default, if lambda is unspecified, return a matrix of predictions for varied lambda values, hence the need to explicitly handle the lambda argument in building glmnet learners.

See also

learners