Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save timcdlucas/1df5297f777be627fc5365a9ce218edc to your computer and use it in GitHub Desktop.
Save timcdlucas/1df5297f777be627fc5365a9ce218edc to your computer and use it in GitHub Desktop.
library(caret)
m <- train(mpg ~ .,
data = mtcars,
method = 'glmnet',
tuneLength = 10)
plot(m)
plot(m$finalModel)
coef(m$finalModel, m$finalModel$lambdaOpt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment