Skip to contents

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

Usage

# 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.245800
#> 2   2  1.06 0.224000
#> 3   2  2.43 0.204100
#> 4   3  3.74 0.185900
#> 5   4  5.50 0.169400
#> 6   4  7.09 0.154400
#> 7   4  8.41 0.140700
#> 8   4  9.51 0.128200
#> 9   5 10.51 0.116800
#> 10  5 11.40 0.106400
#> 11  5 12.14 0.096950
#> 12  6 12.79 0.088340
#> 13  6 13.34 0.080490
#> 14  6 13.80 0.073340
#> 15  7 14.23 0.066830
#> 16  7 14.61 0.060890
#> 17  7 14.92 0.055480
#> 18 10 15.25 0.050550
#> 19 11 15.68 0.046060
#> 20 11 16.06 0.041970
#> 21 11 16.38 0.038240
#> 22 11 16.64 0.034840
#> 23 11 16.86 0.031750
#> 24 14 17.09 0.028930
#> 25 14 17.32 0.026360
#> 26 14 17.51 0.024020
#> 27 15 17.67 0.021880
#> 28 15 17.81 0.019940
#> 29 15 17.92 0.018170
#> 30 15 18.02 0.016550
#> 31 16 18.10 0.015080
#> 32 16 18.17 0.013740
#> 33 16 18.22 0.012520
#> 34 18 18.27 0.011410
#> 35 18 18.31 0.010400
#> 36 18 18.35 0.009472
#> 37 18 18.38 0.008631
#> 38 18 18.40 0.007864
#> 39 18 18.42 0.007165
#> 40 18 18.44 0.006529
#> 41 18 18.45 0.005949
#> 42 18 18.46 0.005420
#> 43 18 18.47 0.004939
#> 44 19 18.48 0.004500
#> 45 19 18.49 0.004100
#> 46 19 18.50 0.003736
#> 47 19 18.50 0.003404
#> 48 19 18.51 0.003102
#> 49 19 18.51 0.002826
#> 50 19 18.51 0.002575
#> 51 19 18.51 0.002346
#> 52 19 18.52 0.002138
#> 53 19 18.52 0.001948
#> 54 19 18.52 0.001775
#> 55 19 18.52 0.001617
#> 56 19 18.52 0.001474
#> 57 19 18.52 0.001343
#> 58 19 18.52 0.001223
#> 59 19 18.52 0.001115
#> 60 19 18.52 0.001016
#> 61 19 18.52 0.000926
#> 62 19 18.52 0.000843
#> 63 19 18.52 0.000768
#> 64 19 18.52 0.000700
#> 65 20 18.53 0.000638
#> 66 20 18.53 0.000581