| Title: | Sparse-Group Lasso via Semismooth Newton Augmented Lagrangian |
|---|---|
| Description: | Implements the sparse-group lasso method of Zhang et al. (2020) <doi:10.1007/s10107-018-1329-6>. Unlike many widely available methods based on first-order descent, this method uses second-order information to solve the dual optimization problem via a semismooth Newton method. |
| Authors: | Robin Liu [aut, cre], Yangjing Zhang [ctb] (Author of the original MATLAB SSNAL implementation this package ports) |
| Maintainer: | Robin Liu <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-12 10:12:47 UTC |
| Source: | https://github.com/roobnloo/sglssnal |
sglssnal objectExtract estimated coefficients from a sglssnal object
## S3 method for class 'sglssnal' coef(object, ...)## S3 method for class 'sglssnal' coef(object, ...)
object |
Fitted object of class |
... |
Additional arguments passed to or from other methods. |
A numeric matrix of estimated coefficients.
set.seed(1) n <- 50 p <- 20 A <- matrix(rnorm(n * p), n, p) b <- rnorm(n) group <- rep(1:4, each = 5) fit <- sglssnal(A, b, group, lambda = 0.5, alpha = 0.5) coef(fit)set.seed(1) n <- 50 p <- 20 A <- matrix(rnorm(n * p), n, p) b <- rnorm(n) group <- rep(1:4, each = 5) fit <- sglssnal(A, b, group, lambda = 0.5, alpha = 0.5) coef(fit)
Perform cross-validation for the sglssnal algorithm over a path of lambda values.
cv.sglssnal( A, b, group, alpha = 0.05, lambda = NULL, nlambda = 100, lambda_min_ratio = 1e-04, nfolds = 5, foldid = NULL, verbose = 1L, stoptol = 1e-06, stoptolcv = 1e-04, ... )cv.sglssnal( A, b, group, alpha = 0.05, lambda = NULL, nlambda = 100, lambda_min_ratio = 1e-04, nfolds = 5, foldid = NULL, verbose = 1L, stoptol = 1e-06, stoptolcv = 1e-04, ... )
A |
|
b |
|
group |
Length- |
alpha |
Mixing parameter determining the relative weight of the |
lambda |
Vector of lambda parameters to tune. If |
nlambda |
Number of lambda values to use when lambda is NULL. |
lambda_min_ratio |
Minimum ratio of the smallest to largest lambda when lambda is NULL. |
nfolds |
Number of folds for cross-validation.
Ignored if |
foldid |
Vector of integers specifying the fold for each observation.
If |
verbose |
How much to print to the console: |
stoptol |
Tolerance for stopping criteria. Default is |
stoptolcv |
Tolerance for convergence in cross-validation folds.
May be set to a smaller value than |
... |
Additional arguments passed to |
List of class cv.sglssnal, sglssnal, containing the following components:
obj: Matrix containing primal and dual objective values for the solution.
x: Matrix of primal variables, with each column corresponding to a lambda.
x0: Vector of intercept values for each lambda.
y: Matrix of y dual variables, with each column corresponding to a lambda.
z: Matrix of z dual variables, with each column corresponding to a lambda.
info: List containing information about the optimization process.
cv_info: List containing the lambdas, cross-validation errors, and
the index of the optimal lambda.
set.seed(1) n <- 50 p <- 20 A <- matrix(rnorm(n * p), n, p) bstar <- c(rnorm(5), rep(0, p - 5)) b <- as.numeric(A %*% bstar + rnorm(n, sd = 0.1)) group <- rep(1:4, each = 5) cvfit <- cv.sglssnal(A, b, group, nlambda = 10, nfolds = 3) cvfit$cv_info$cv_lambda_idset.seed(1) n <- 50 p <- 20 A <- matrix(rnorm(n * p), n, p) bstar <- c(rnorm(5), rep(0, p - 5)) b <- as.numeric(A %*% bstar + rnorm(n, sd = 0.1)) group <- rep(1:4, each = 5) cvfit <- cv.sglssnal(A, b, group, nlambda = 10, nfolds = 3) cvfit$cv_info$cv_lambda_id
sglssnal objectsPredict method for sglssnal objects
## S3 method for class 'sglssnal' predict(object, newdata, ...)## S3 method for class 'sglssnal' predict(object, newdata, ...)
object |
Fitted object of class |
newdata |
A matrix of new data. |
... |
Additional arguments passed to or from other methods. |
A numeric matrix of predictions, with columns corresponding to lambda values.
set.seed(1) n <- 50 p <- 20 A <- matrix(rnorm(n * p), n, p) b <- rnorm(n) group <- rep(1:4, each = 5) fit <- sglssnal(A, b, group, lambda = 0.5, alpha = 0.5) predict(fit, A)set.seed(1) n <- 50 p <- 20 A <- matrix(rnorm(n * p), n, p) b <- rnorm(n) group <- rep(1:4, each = 5) fit <- sglssnal(A, b, group, lambda = 0.5, alpha = 0.5) predict(fit, A)
A real, pre-processed dataset of riboflavin (vitamin B2)
production by engineered Bacillus subtilis strains, arranged for
direct use with sglssnal()/cv.sglssnal(). Predictors are gene
expression levels; genes are grouped by their "generic GO Slim"
Biological Process term (36 groups).
riboflavinriboflavin
A list with components:
71 x 1199 numeric matrix of log gene-expression levels, one
row per strain variant, one column per gene. Column names are the
original Affymetrix probe IDs (e.g. "AADK_at"); row names are the
original microarray scan identifiers.
Length-71 numeric vector of log-transformed riboflavin production rate.
Length-1199 character vector giving the GO term ID (e.g.
"GO:0006766") for each column of A, suitable for the group
argument of sglssnal(). Group sizes range from 284 genes
(transmembrane transport) down to singletons. 13% of these genes
have GO annotations spanning more than one Slim term; since group
requires a strict partition, each such gene was assigned to its
most-frequently annotated Slim term.
Gene expression and production-rate data: Bühlmann, P., Kalisch,
M. and Meier, L. (2014). High-dimensional statistics with a view
towards applications in biology. Annual Review of Statistics and its
Application, 1, 255-278. Data kindly provided by DSM (Switzerland);
originally distributed in the hdi package. Gene-to-GO-term
annotations: UniProt-GOA B. subtilis 168 proteome annotation file,
https://ftp.ebi.ac.uk/pub/databases/GO/goa/proteomes/
(GO release 2026-07-26). GO Slim term set: goslim_generic,
https://current.geneontology.org/ontology/subsets/goslim_generic.obo.
Gene Ontology Consortium data and data products are licensed under
CC BY 4.0; see
https://geneontology.org/docs/go-citation-policy/.
fit <- sglssnal(riboflavin$A, riboflavin$b, riboflavin$group, lambda = 0.05) coef(fit)fit <- sglssnal(riboflavin$A, riboflavin$b, riboflavin$group, lambda = 0.05) coef(fit)
Fits a sparse-group lasso model using second-order information to solve the dual problem. The penalty function is given by
where is the -th group, its penalty factor,
and mixes the and group penalties.
The primal problem is given by
while the dual problem has the form
where denotes the Fenchel conjugate of .
The algorithm is based on the work of Zhang et al. (2020).
sglssnal( A, b, group, lambda = NULL, nlambda = 100, lambda_min_ratio = 1e-04, alpha = 0.05, pfgroup = sqrt(as.numeric(table(group))), intercept = TRUE, standardize = TRUE, stoptol = 1e-06, stopopt = 2L, verbose = 1L, maxit = 5000L, Lip = NULL, y0 = NULL, z0 = NULL, x0 = NULL )sglssnal( A, b, group, lambda = NULL, nlambda = 100, lambda_min_ratio = 1e-04, alpha = 0.05, pfgroup = sqrt(as.numeric(table(group))), intercept = TRUE, standardize = TRUE, stoptol = 1e-06, stopopt = 2L, verbose = 1L, maxit = 5000L, Lip = NULL, y0 = NULL, z0 = NULL, x0 = NULL )
A |
|
b |
|
group |
Length- |
lambda |
Vector of penalty parameters or a single value. If |
nlambda |
Number of lambda values to use when |
lambda_min_ratio |
Minimum ratio of the smallest to largest lambda when |
alpha |
Determines the relative weight of the |
pfgroup |
Penalty factor for each group in the group lasso, ordered
by |
intercept |
Centers mean function at 0 through |
standardize |
Whether to standardize the columns of A to have unit norm.
Default is |
stoptol |
Tolerance for stopping criteria. Default is |
stopopt |
Stopping criteria. 1: relative duality gap and feasibility,
2: KKT conditions, 3: dual feasibility and relative duality gap,
4: dual feasibility and absolute duality gap. Default is |
verbose |
How much to print to the console: |
maxit |
Maximum number of iterations. Default is |
Lip |
Lipschitz constant for the step size.
Automatically computed as the maximum eigenvalue of AA' if |
y0 |
optional initialization vector for dual variable |
z0 |
optional initialization vector for dual variable |
x0 |
optional initialization vector for primal variable |
List of class sglssnal containing the following components:
obj: Matrix containing primal and dual objective values for each lambda.
x: Matrix of primal variables, with each column corresponding to a lambda.
x0: Vector of intercept values for each lambda.
y: Matrix of y dual variables, with each column corresponding to a lambda.
z: Matrix of z dual variables, with each column corresponding to a lambda.
info: List containing information about the optimization process for each lambda.
lambda: Vector of lambda values used.
Zhang, Y., Zhang, N., Sun, D., & Toh, K. C. (2020). An efficient Hessian based algorithm for solving large-scale sparse group Lasso problems. Mathematical Programming, 179, 223-263. doi:10.1007/s10107-018-1329-6.
set.seed(1) n <- 50 p <- 20 A <- matrix(rnorm(n * p), n, p) bstar <- c(rnorm(5), rep(0, p - 5)) b <- as.numeric(A %*% bstar + rnorm(n, sd = 0.1)) group <- rep(1:4, each = 5) fit <- sglssnal(A, b, group, lambda = 0.5, alpha = 0.5) coef(fit)set.seed(1) n <- 50 p <- 20 A <- matrix(rnorm(n * p), n, p) bstar <- c(rnorm(5), rep(0, p - 5)) b <- as.numeric(A %*% bstar + rnorm(n, sd = 0.1)) group <- rep(1:4, each = 5) fit <- sglssnal(A, b, group, lambda = 0.5, alpha = 0.5) coef(fit)