extractPath | R Documentation |
Extracts the coefficient path of the elastic net
extractPath(model, ...)
## S3 method for class 'glmnet'
extractPath(model, intercept = FALSE, ...)
## S3 method for class 'cv.glmnet'
extractPath(model, ...)
model |
A |
... |
Further arguments |
intercept |
If |
This is a replacement plot for visualizing the coefficient path resulting from the elastic net.
A link[tibble]{tibble}
holding the coefficients for various lambdas
Jared P. Lander
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.