plot.cv.plasso | R Documentation |
Plot of cross-validation curves.
## S3 method for class 'cv.plasso'
plot(
x,
...,
legend_pos = c("bottomright", "bottom", "bottomleft", "left", "topleft", "top",
"topright", "right", "center"),
legend_size = 0.5,
lasso = FALSE
)
x |
|
... |
Pass generic |
legend_pos |
Legend position. Only considered for joint plot (lass=FALSE). |
legend_size |
Font size of legend |
lasso |
If set as True, only the cross-validation curve for the Lasso model is plotted. Default is False. |
Plots the cross-validation curves for both Lasso and Post-Lasso models (incl. upper and lower standard deviation curves)
for a fitted cv.plasso
object.
# load toeplitz data
data(toeplitz)
# extract target and features from data
y = as.matrix(toeplitz[,1])
X = toeplitz[,-1]
# fit cv.plasso to the data
p.cv = plasso::cv.plasso(X,y)
# plot cross-validated MSE curves and number of active coefficients
plot(p.cv, legend_pos="bottomleft")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.