
print a cross-validated glmnet object
print.cv.glmnet.RdPrint a summary of the results of cross-validation for a glmnet model.
Details
A summary of the cross-validated fit is produced, slightly different for a
'cv.relaxed' object than for a 'cv.glmnet' object. Note that a 'cv.relaxed'
object inherits from class 'cv.glmnet', so by directly invoking
print.cv.glmnet(object) will print the summary as if
relax=TRUE had not been used.
References
Friedman, J., Hastie, T. and Tibshirani, R. (2008)
Regularization Paths for Generalized Linear Models via Coordinate
Descent
https://arxiv.org/abs/1707.08692
Hastie, T.,
Tibshirani, Robert, Tibshirani, Ryan (2019) Extended Comparisons of
Best Subset Selection, Forward Stepwise Selection, and the Lasso
Author
Jerome Friedman, Trevor Hastie and Rob Tibshirani
Maintainer:
Trevor Hastie [email protected]
Examples
x = matrix(rnorm(100 * 20), 100, 20)
y = rnorm(100)
fit1 = cv.glmnet(x, y)
print(fit1)
#>
#> Call: cv.glmnet(x = x, y = y)
#>
#> Measure: Mean-Squared Error
#>
#> Lambda Index Measure SE Nonzero
#> min 0.1510 6 1.070 0.1010 1
#> 1se 0.2405 1 1.095 0.1029 0
fit1r = cv.glmnet(x, y, relax = TRUE)
print(fit1r)
#>
#> Call: cv.glmnet(x = x, y = y, relax = TRUE)
#>
#> Measure: Mean-Squared Error
#>
#> Gamma Index Lambda Index Measure SE Nonzero
#> min 0 1 0.1657 5 1.066 0.09863 1
#> 1se 1 5 0.2405 1 1.114 0.10027 0
## print.cv.glmnet(fit1r) ## CHECK WITH TREVOR