print.sprinter: Print a summary of the sprinter fit

Description Usage Arguments Details See Also Examples

View source: R/print.sprinter.R

Description

Print a summary of the sprinter fit at each step along the path of tuning parameters used in Step 3, for any given tuning parameter in Step 1.

Usage

1
2
## S3 method for class 'sprinter'
print(fit, which = 1, digits = max(3, getOption("digits") - 3), ...)

Arguments

fit

A sprinter object.

which

Which tuning parameter of Step 1 to print. Default is 1.

digits

Significant digits in printout.

...

Additional print arguments.

Details

The function produces a three-column matrix with tuning parameter values (in Step 3), number of nonzero main effects, and the number of nonzero interactions. Adopted from the function print.rgam from package relgam by Kenneth Tay and Robert Tibshirani.

See Also

sprinter.

Examples

1
2
3
4
5
6
7
8
set.seed(123)
n <- 100
p <- 100
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)
fit <- sprinter(x = x, y = y)

print(fit, which = 3)

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