extractPath {coefplot} | R Documentation |
extractPath
Description
Extracts the coefficient path of the elastic net
Usage
extractPath(model, ...)
## S3 method for class 'glmnet'
extractPath(model, intercept = FALSE, ...)
## S3 method for class 'cv.glmnet'
extractPath(model, ...)
Arguments
model |
A |
... |
Further arguments |
intercept |
If |
Details
This is a replacement plot for visualizing the coefficient path resulting from the elastic net.
Value
A link[tibble]{tibble}
holding the coefficients for various lambdas
Author(s)
Jared P. Lander
Examples
library(glmnet)
data(diamonds, package='ggplot2')
diaX <- useful::build.x(price ~ carat + cut + x - 1, data=diamonds, contrasts = TRUE)
diaY <- useful::build.y(price ~ carat + cut + x - 1, data=diamonds)
modG1 <- glmnet(x=diaX, y=diaY)
extractPath(modG1)
modG2 <- cv.glmnet(x=diaX, y=diaY, nfolds=5)
extractPath(modG2)
[Package coefplot version 1.2.8 Index]