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

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

Arguments

x

fitted glmnet object

digits

significant digits in printout

...

additional print arguments

Value

The matrix above is silently returned

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). In the case of a 'relaxed' fit, an additional column is inserted, %Dev R which gives the percent deviance explained by the relaxed model. For a "bigGlm" model, a simpler summary is printed.

References

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

See also

glmnet, predict and coef methods.

Examples


x = matrix(rnorm(100 * 20), 100, 20)
y = rnorm(100)
fit1 = glmnet(x, y)
print(fit1)
#> 
#> Call:  glmnet(x = x, y = y) 
#> 
#>    Df  %Dev   Lambda
#> 1   0  0.00 0.209400
#> 2   2  1.24 0.190800
#> 3   3  2.57 0.173800
#> 4   3  3.89 0.158400
#> 5   4  5.06 0.144300
#> 6   6  6.70 0.131500
#> 7   8  8.54 0.119800
#> 8   8 10.25 0.109200
#> 9   8 11.67 0.099460
#> 10  8 12.85 0.090630
#> 11  8 13.83 0.082580
#> 12  8 14.64 0.075240
#> 13  8 15.32 0.068560
#> 14  9 15.97 0.062470
#> 15 10 16.53 0.056920
#> 16 13 17.08 0.051860
#> 17 13 17.62 0.047250
#> 18 13 18.08 0.043060
#> 19 13 18.46 0.039230
#> 20 14 18.77 0.035750
#> 21 16 19.09 0.032570
#> 22 16 19.36 0.029680
#> 23 16 19.58 0.027040
#> 24 16 19.77 0.024640
#> 25 16 19.92 0.022450
#> 26 17 20.07 0.020460
#> 27 18 20.20 0.018640
#> 28 18 20.32 0.016980
#> 29 18 20.41 0.015470
#> 30 18 20.49 0.014100
#> 31 19 20.56 0.012850
#> 32 19 20.62 0.011710
#> 33 19 20.67 0.010670
#> 34 19 20.71 0.009718
#> 35 19 20.74 0.008854
#> 36 19 20.77 0.008068
#> 37 19 20.79 0.007351
#> 38 19 20.81 0.006698
#> 39 19 20.83 0.006103
#> 40 19 20.84 0.005561
#> 41 19 20.86 0.005067
#> 42 19 20.86 0.004617
#> 43 19 20.87 0.004207
#> 44 19 20.88 0.003833
#> 45 19 20.88 0.003492
#> 46 19 20.89 0.003182
#> 47 19 20.89 0.002899
#> 48 19 20.89 0.002642
#> 49 20 20.90 0.002407
#> 50 20 20.90 0.002193
#> 51 20 20.90 0.001998
#> 52 20 20.90 0.001821
#> 53 20 20.90 0.001659
#> 54 20 20.91 0.001512
#> 55 20 20.91 0.001377
#> 56 20 20.91 0.001255
#> 57 20 20.91 0.001144
#> 58 20 20.91 0.001042
#> 59 20 20.91 0.000949
#> 60 20 20.91 0.000865
#> 61 20 20.91 0.000788
#> 62 20 20.91 0.000718
#> 63 20 20.91 0.000654
#> 64 20 20.91 0.000596