Learn R Programming

kerndwd (version 2.0.3)

plot.cv.kerndwd: plot the cross-validation curve

Description

Plot cross-validation error curves with the upper and lower standard deviations versus log lambda values.

Usage

# S3 method for cv.kerndwd
plot(x, sign.lambda, ...)

Arguments

x

A fitted cv.kerndwd object.

sign.lambda

Against log(lambda) (default) or its negative if sign.lambda=-1.

Other graphical parameters being passed to plot.

Details

This function plots the cross-validation error curves. This function is modified based on the plot.cv function of the glmnet package.

References

Wang, B. and Zou, H. (2018) ``Another Look at Distance Weighted Discrimination," Journal of Royal Statistical Society, Series B, 80(1), 177--198. https://rss.onlinelibrary.wiley.com/doi/10.1111/rssb.12244

Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized linear models via coordinate descent," Journal of Statistical Software, 33(1), 1--22. https://www.jstatsoft.org/v33/i01/paper

See Also

cv.kerndwd.

Examples

Run this code
# NOT RUN {
set.seed(1)
data(BUPA)
BUPA$X = scale(BUPA$X, center=TRUE, scale=TRUE)
lambda = 10^(seq(-3, 3, length.out=10))
kern = rbfdot(sigma=sigest(BUPA$X))
m.cv = cv.kerndwd(BUPA$X, BUPA$y, kern,
  qval=1, lambda=lambda, eps=1e-5, maxit=1e5)
m.cv
# }

Run the code above in your browser using DataLab