plot.cv.sail: Plot the cross-validation curve produced by 'cv.sail'

Description Usage Arguments Details Value References See Also Examples

View source: R/methods.R

Description

Plots the cross-validation curve, and upper and lower standard deviation curves, as a function of the lambda values used.

Usage

1
2
## S3 method for class 'cv.sail'
plot(x, sign.lambda = 1, ...)

Arguments

x

fitted cv.sail object

sign.lambda

Either plot against log(lambda) (default) or its negative if sign.lambda=-1.

...

Other graphical parameters to plot

Details

This is a port of plot.cv.glmnet

Value

A plot is produced and nothing is returned

References

Jerome Friedman, Trevor Hastie, Robert Tibshirani (2010). Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software, 33(1), 1-22. http://www.jstatsoft.org/v33/i01/.

See Also

sail, cv.sail

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data("sailsim")
f.basis <- function(i) splines::bs(i, degree = 3)
library(doParallel)
cl <- makeCluster(2)
registerDoParallel(cl)
cvfit <- cv.sail(x = sailsim$x, y = sailsim$y, e = sailsim$e,
                 parallel = TRUE, nlambda = 10,
                 maxit = 100, basis = f.basis,
                 nfolds = 3, dfmax = 10)
stopCluster(cl)
plot(cvfit)

sahirbhatnagar/sail documentation built on July 17, 2021, 5:10 a.m.