plot.cv.sparseSVM {sparseSVM}R Documentation

Plot the cross-validation curve for a "cv.sparseSVM" object

Description

Plot the cross-validation curve for a "cv.sparseSVM" object against the lambda values used, along with standard error bars.

Usage

## S3 method for class 'cv.sparseSVM'
plot(x, log.l = TRUE, nvars = TRUE, ...)

Arguments

x

A "cv.sparseSVM" object.

log.l

Should log(lambda) be used instead of lambda for the X-axis? Default is TRUE.

nvars

If TRUE (the default), places an axis on top of the plot denoting the number of variables with nonzero coefficients at each lambda.

...

Other graphical parameters to plot

Details

Produces a plot of mean cv errors at each lambda along with upper and lower standard error bars.

Author(s)

Congrui Yi and Yaohui Zeng
Maintainer: Congrui Yi <eric.ycr@gmail.com>

See Also

sparseSVM, cv.sparseSVM

Examples

X = matrix(rnorm(1000*100), 1000, 100)
b = 3
w = 5*rnorm(10)
eps = rnorm(1000)
y = sign(b + drop(X[,1:10] %*% w + eps))

cv.fit <- cv.sparseSVM(X, y, ncores = 2, seed = 1234)
plot(cv.fit)
plot(cv.fit, log.l = FALSE)

[Package sparseSVM version 1.1-6 Index]