Learn R Programming

aurelius (version 0.8.4)

extract_params.glmnet: extract_params.glmnet

Description

Extract generalized linear model net parameters from the glmnet library

Usage

# S3 method for glmnet
extract_params(object, lambda = NULL, ...)

Arguments

object

an object of class "glmnet"

lambda

a numeric value of the penalty parameter lambda at which coefficients are required

...

further arguments passed to or from other methods

Value

a list of lists that can be modified to insert into a cell or pool

Examples

Run this code
X <- matrix(c(rnorm(100), runif(100)), nrow=100, ncol=2)
Y <- factor(3 - 5 * X[,1] + 3 * X[,2] + rnorm(100, 0, 3) > 0)

model <- glmnet::glmnet(X, Y, family = 'binomial')
my_model_params <- extract_params(model)

Run the code above in your browser using DataLab