print.glmnetcr: Print a 'glmnetcr' Object

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/print.glmnetcr.R

Description

Print a summary of the glmnetcr path at each step along the path.

Usage

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

Arguments

x

fitted glmnetcr object

digits

significant digits in printout

...

additional print arguments

Details

The call that produced the object x is printed, followed by a three-column matrix with columns Df, %dev and Lambda. The Df column is the number of nonzero coefficients (Df is a reasonable name only for lasso fits). %dev is the percent deviance explained (relative to the null deviance).

Value

The matrix above is silently returned

Note

This function is essentially the same as print.glmnet from the glmnet package by but was edited to operate on a returned glmnetcr object.

Author(s)

Jerome Friedman, Trevor Hastie and Rob Tibshirani

References

Friedman, J., Hastie, T. and Tibshirani, R. (2008) Regularization Paths for Generalized Linear Models via Coordinate Descent

See Also

See Also as glmnetcr

Examples

1
2
3
4
5
data(diabetes)
x <- diabetes[, 2:dim(diabetes)[2]]
y <- diabetes$y
glmnet.fit <- glmnetcr(x, y)
print(glmnet.fit)

Example output

Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-12

Warning message:
from glmnet Fortran code (error code -26); Convergence for 26th lambda value not reached after maxit=100 iterations; solutions for larger lambdas returned 

Call:  glmnet(x = glmnet.data$x, y = glmnet.data$y, family = "binomial",      weights = glmnet.data$weights, offset = offset, alpha = alpha,      nlambda = nlambda, lambda.min.ratio = lambda.min.ratio, lambda = lambda,      standardize = standardize, thresh = thresh, exclude = exclude,      penalty.factor = c(penalty.factor, rep(0, k - 1)), maxit = maxit,      type.gaussian = ifelse(nvars < 500, "covariance", "naive")) 

      Df     %Dev Lambda
 [1,]  2 0.006051 0.3914
 [2,]  3 0.053980 0.3736
 [3,]  3 0.098090 0.3566
 [4,]  3 0.138700 0.3404
 [5,]  3 0.176400 0.3249
 [6,]  3 0.211400 0.3102
 [7,]  3 0.244000 0.2961
 [8,]  3 0.274500 0.2826
 [9,]  3 0.303100 0.2698
[10,]  3 0.330000 0.2575
[11,]  3 0.355400 0.2458
[12,]  3 0.379400 0.2346
[13,]  3 0.402200 0.2240
[14,]  3 0.423700 0.2138
[15,]  3 0.444200 0.2041
[16,]  3 0.463800 0.1948
[17,]  3 0.482400 0.1859
[18,]  3 0.500200 0.1775
[19,]  3 0.517200 0.1694
[20,]  3 0.533500 0.1617
[21,]  4 0.550800 0.1544
[22,]  4 0.568300 0.1474
[23,]  4 0.585100 0.1407
[24,]  4 0.601300 0.1343
[25,]  6 0.617300 0.1282

glmnetcr documentation built on July 8, 2020, 6:21 p.m.