Description Usage Arguments Value Examples
Plots paths for features in the final model in color and provides a legend for these features only. Features not in the final are plotted in grey and not included in the legend.
1 2 |
object |
Object of class |
rule |
Either "min" or "1-se". Specifies whether lambda should be
selected to minimize CV error, or to find the sparsest model within one standard
deviation of the minimum error. Default |
... |
Other arguments to autoplot. Ignored. |
ggplot2 object with elastic net paths
1 2 3 4 5 6 7 8 | library(glmnet)
data(Boston, package = "MASS")
X <- model.matrix(medv ~ ., Boston)
y <- Boston$medv
cv_model <- cv.glmnet(X, y)
autoplot(cv_model, rule = "min")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.