Learn R Programming

sail (version 0.1.0)

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

Description

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

Usage

# S3 method for 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

Value

A plot is produced and nothing is returned

Details

This is a port of plot.cv.glmnet

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab