plot.cv.plasso {plasso}R Documentation

Plot of cross-validation curves

Description

Plot of cross-validation curves.

Usage

## 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
)

Arguments

x

cv.plasso object

...

Pass generic plot options

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.

Value

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.

Examples

# 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")


[Package plasso version 0.1.2 Index]