sparsegl
The goal of sparsegl is to fit regularization paths for sparse group-lasso penalized learning problems. The model is fit for a sequence of the regularization parameter lambda.
You can install the released version of sparsegl from CRAN with:
install.packages("sparsegl")
You can install the development version from Github with:
# install.packages("remotes")
::install_github("dajmcdon/sparsegl") remotes
set.seed(1010)
<- 100
n <- 200
p <- matrix(data = rnorm(n*p, mean = 0, sd = 1), nrow = n, ncol = p)
X <- rnorm(n, mean = 0, sd = 1)
eps <- c(rep(5, 5), c(5, -5, 2, 0, 0),
beta_star rep(-5, 5), c(2, -3, 8, 0, 0), rep(0, (p - 20)))
<- X %*% beta_star + eps
y <- rep(1:(p / 5), each = 5)
groups <- sparsegl(X, y, group = groups)
fit1 plot(fit1, y_axis = "coef", x_axis = "penalty", add_legend = FALSE)
The package documentation and more examples are available online.