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

Description Usage Arguments Details Author(s) See Also Examples

View source: R/plot.cv.sparseSVM.R

Description

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

Usage

1
2
## 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

1
2
3
4
5
6
7
8
9
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)

sparseSVM documentation built on May 2, 2019, 11:02 a.m.