mytidy.glmnet: -@templateVar class glmnet

View source: R/glmnet-mytidy.R

mytidy.glmnetR Documentation

-@templateVar class glmnet

Description

-@template title_desc_tidy

Usage

## S3 method for class 'glmnet'
mytidy(x, return_zeros = FALSE, unnest = FALSE, ...)

Arguments

x

A glmnet object returned from glmnet::glmnet().

'return_zeros'

Logical indicating whether coefficients with value zero zero should be included in the results. Defaults to FALSE.

  • @template param_unused_dots

Details

Note that while this representation of GLMs is much easier to plot and combine than the default structure, it is also much more memory-intensive. Do not use for large, sparse matrices.

No augment method is yet provided even though the model produces predictions, because the input data is not tidy (it is a matrix that may be very wide) and therefore combining predictions with it is not logical. Furthermore, predictions make sense only with a specific choice of lambda.

Value

A tibble::tibble() with columns:

dev.ratio

Fraction of null deviance explained at each value of lambda.

estimate

The estimated value of the regression term.

lambda

Value of penalty parameter lambda.

step

Which step of lambda choices was used.

term

The name of the regression term.

step.label

Label used by 'glmnet'. It refers to column name in a matrix of coefficients. See example.

df.step

The number of nonzero coefficients for each value of lambda. For multnet, the number of variables with a nonzero coefficient for any class.


agalecki/utilsag documentation built on Jan. 25, 2023, 5:36 a.m.