grpnet | R Documentation |
Computes a group elastic-net regularization path for a variety of
GLM and other families, including the Cox model. This function
extends the abilities of the glmnet
package to allow for
grouped regularization. The code is very efficient (core routines
are written in C++), and allows for specialized matrix
classes.
grpnet(
X,
glm,
constraints = NULL,
groups = NULL,
alpha = 1,
penalty = NULL,
offsets = NULL,
lambda = NULL,
standardize = TRUE,
irls_max_iters = as.integer(10000),
irls_tol = 1e-07,
max_iters = as.integer(1e+05),
tol = 1e-07,
adev_tol = 0.9,
ddev_tol = 0,
newton_tol = 1e-12,
newton_max_iters = 1000,
n_threads = 1,
early_exit = TRUE,
intercept = TRUE,
screen_rule = c("pivot", "strong"),
min_ratio = 0.01,
lmda_path_size = 100,
max_screen_size = NULL,
max_active_size = NULL,
pivot_subset_ratio = 0.1,
pivot_subset_min = 1,
pivot_slack_ratio = 1.25,
check_state = FALSE,
progress_bar = FALSE,
warm_start = NULL
)
X |
Feature matrix. Either a regualr R matrix, or else an
|
glm |
GLM family/response object. This is an expression that
represents the family, the reponse and other arguments such as
weights, if present. The choices are |
constraints |
Constraints on the parameters. Currently these are ignored. |
groups |
This is an ordered vector of integers that represents the groupings,
with each entry indicating where a group begins. The entries refer to column numbers
in the feature matrix.
If there are |
alpha |
The elasticnet mixing parameter, with
where thte sum is over groups.
|
penalty |
Separate penalty factors can be applied to each group of coefficients.
This is a number that multiplies |
offsets |
Offsets, default is |
lambda |
A user supplied |
standardize |
If |
irls_max_iters |
Maximum number of IRLS iterations, default is
|
irls_tol |
IRLS convergence tolerance, default is |
max_iters |
Maximum total number of coordinate descent
iterations, default is |
tol |
Coordinate descent convergence tolerance, default |
adev_tol |
Fraction deviance explained tolerance, default
|
ddev_tol |
Difference in fraction deviance explained
tolerance, default |
newton_tol |
Convergence tolerance for the BCD update, default
|
newton_max_iters |
Maximum number of iterations for the BCD
update, default |
n_threads |
Number of threads, default |
early_exit |
|
intercept |
Default |
screen_rule |
Screen rule, with default |
min_ratio |
Ratio between smallest and largest value of lambda. Default is 1e-2. |
lmda_path_size |
Number of values for |
max_screen_size |
Maximum number of screen groups. Default is |
max_active_size |
Maximum number of active groups. Default is |
pivot_subset_ratio |
Subset ratio of pivot rule. Default is |
pivot_subset_min |
Minimum subset of pivot rule. Defaults is |
pivot_slack_ratio |
Slack ratio of pivot rule, default is |
check_state |
Check state. Internal parameter, with default |
progress_bar |
Progress bar. Default is |
warm_start |
Warm start (default is |
A list of class "grpnet"
. This has a main component called state
which
represents the fitted path, and a few extra
useful components such as the call
, the family
name, and group_sizes
.
Users typically use methods like predict()
, print()
, plot()
etc to examine the object.
James Yang, Trevor Hastie, and Balasubramanian Narasimhan
Maintainer: Trevor Hastie
hastie@stanford.edu
Yang, James and Hastie, Trevor. (2024) A Fast and Scalable Pathwise-Solver for Group Lasso
and Elastic Net Penalized Regression via Block-Coordinate Descent. arXiv \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2405.08631")}.
Friedman, J., Hastie, T. and Tibshirani, R. (2008)
Regularization Paths for Generalized Linear Models via Coordinate
Descent (2010), Journal of Statistical Software, Vol. 33(1), 1-22,
\Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v033.i01")}.
Simon, N., Friedman, J., Hastie, T. and Tibshirani, R. (2011)
Regularization Paths for Cox's Proportional
Hazards Model via Coordinate Descent, Journal of Statistical Software, Vol.
39(5), 1-13,
\Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v039.i05")}.
Tibshirani,Robert, Bien, J., Friedman, J., Hastie, T.,Simon, N.,Taylor, J. and
Tibshirani, Ryan. (2012) Strong Rules for Discarding Predictors in
Lasso-type Problems, JRSSB, Vol. 74(2), 245-266,
https://arxiv.org/abs/1011.2234.
cv.grpnet
, predict.grpnet
, plot.grpnet
, print.grpnet
.
set.seed(0)
n <- 100
p <- 200
X <- matrix(rnorm(n * p), n, p)
y <- X[,1] * rnorm(1) + rnorm(n)
fit <- grpnet(X, glm.gaussian(y))
print(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.