plot.cv.sprinter: Plot function of cv.sprinter fit

Description Usage Arguments Details See Also Examples

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

Description

This function produces plots of cross-validation for cv.sprinter.

Usage

1
2
## S3 method for class 'cv.sprinter'
plot(fit)

Arguments

fit

A "cv.sprinter" object.

Details

The orange pairs on the top of the plot shows the number of non-zero (main effects, interactions) selected by each value of lambda. Adopted from the function plot.cv.rgam from package relgam by Kenneth Tay and Robert Tibshirani.

See Also

cv.sprinter.

Examples

1
2
3
4
5
6
7
8
9
set.seed(123)
n <- 100
p <- 200
# dense input
x <- matrix(rnorm(n * p), n, p)
y <- x[, 1] - 2 * x[, 2] + 3 * x[, 1] * x[, 3] - 4 * x[, 4] * x[, 5] + rnorm(n)
mod <- cv.sprinter(x = x, y = y)

plot(mod)

hugogogo/sprintr documentation built on Dec. 14, 2021, 6:07 p.m.