Package: dfr 0.1.5
dfr: Dual Feature Reduction for SGL
Implementation of the Dual Feature Reduction (DFR) approach for the Sparse Group Lasso (SGL) and the Adaptive Sparse Group Lasso (aSGL) (Feser and Evangelou (2024) <doi:10.48550/arXiv.2405.17094>). The DFR approach is a feature reduction approach that applies strong screening to reduce the feature space before optimisation, leading to speed-up improvements for fitting SGL (Simon et al. (2013) <doi:10.1080/10618600.2012.681250>) and aSGL (Mendez-Civieta et al. (2020) <doi:10.1007/s11634-020-00413-8> and Poignard (2020) <doi:10.1007/s10463-018-0692-7>) models. DFR is implemented using the Adaptive Three Operator Splitting (ATOS) (Pedregosa and Gidel (2018) <doi:10.48550/arXiv.1804.02339>) algorithm, with linear and logistic SGL models supported, both of which can be fit using k-fold cross-validation. Dense and sparse input matrices are supported.
Authors:
dfr_0.1.5.tar.gz
dfr_0.1.5.tar.gz(r-4.5-noble)dfr_0.1.5.tar.gz(r-4.4-noble)
dfr_0.1.5.tgz(r-4.4-emscripten)dfr_0.1.5.tgz(r-4.3-emscripten)
dfr.pdf |dfr.html✨
dfr/json (API)
# Install 'dfr' in R: |
install.packages('dfr', repos = 'https://cloud.r-project.org') |
Bug tracker:https://github.com/ff1201/dfr/issues2 issues
Last updated 27 days agofrom:222b23f935. Checks:3 OK. Indexed: no.
Target | Result | Latest binary |
---|---|---|
Doc / Vignettes | OK | Mar 06 2025 |
R-4.5-linux | OK | Mar 06 2025 |
R-4.4-linux | OK | Mar 06 2025 |
Exports:dfr_adap_sgldfr_adap_sgl.cvdfr_sgldfr_sgl.cv
Dependencies:caretclasscliclockcodetoolscolorspacecpp11data.tablediagramdigestdplyre1071fansifarverforeachfuturefuture.applygenericsggplot2globalsgluegowergtablehardhatipredisobanditeratorsKernSmoothlabelinglatticelavalifecyclelistenvlubridatemagrittrMASSMatrixmgcvModelMetricsmunsellnlmennetnumDerivparallellypillarpkgconfigplyrpROCprodlimprogressrproxypurrrR6RColorBrewerRcppRcppArmadillorecipesreshape2RlabrlangrpartscalessgsshapeSLOPEsparsevctrsSQUAREMstringistringrsurvivaltibbletidyrtidyselecttimechangetimeDatetzdbutf8vctrsviridisLitewithr
Citation
To cite the DFR method in publications use
Feser F, Evangelou M (2024). “Dual feature reduction for the sparse-group lasso and its adaptive variant.” arXiv. doi:10.48550/arXiv.2405.17094, https://arxiv.org/abs/2405.17094.
To cite the dfr R package in publications use:
Feser F (2024). dfr. https://CRAN.R-project.org/package=dfr.
Corresponding BibTeX entries:
@Article{, title = {Dual feature reduction for the sparse-group lasso and its adaptive variant}, author = {Fabio Feser and Marina Evangelou}, journal = {arXiv}, year = {2024}, doi = {10.48550/arXiv.2405.17094}, url = {https://arxiv.org/abs/2405.17094}, }
@Manual{, title = {dfr}, author = {Fabio Feser}, year = {2024}, url = {https://CRAN.R-project.org/package=dfr}, }
Readme and manuals
dfr

Implementation of the Dual Feature Reduction (DFR) approach for the Sparse Group Lasso (SGL) and the Adaptive Sparse Group Lasso (aSGL). The DFR approach is a feature reduction approach that applies strong screening to reduce the feature space before optimisation, leading to speed-up improvements for fitting SGL models. DFR is implemented using the Adaptive Three Operator Splitting (ATOS) algorithm, with linear and logistic SGL models supported, both of which can be fit using k-fold cross-validation. Dense and sparse input matrices are supported.
A detailed description of DFR can be found in Feser, F., Evangelou, M. (2024). "Dual feature reduction for the sparse-group lasso and its adaptive variant".
SGL was proposed in Simon, N., Friedman, J., Hastie, T., Tibshirani, R. (2013). "A Sparse-Group Lasso".
The adaptive SGL is described in Mendez-Civieta, A., Carmen Aguilera-Morillo, M., Lillo, R. (2020). "Adaptive sparse group LASSO in quantile regression" and Poignard, B. (2020). "Asymptotic theory of the adaptive Sparse Group Lasso".
Installation
You can install the current stable release from CRAN with
install.packages("dfr")
Your R configuration must allow for a working Rcpp. To install a develop the development version from GitHub run
library(devtools)
install_github("ff1201/dfr")
Example
The code for fitting a basic DFR-SGL model is:
library(dfr)
groups = c(rep(1:20, each=3),
rep(21:40, each=4),
rep(41:60, each=5),
rep(61:80, each=6),
rep(81:100, each=7))
data = sgs::gen_toy_data(p=500, n=400, groups = groups, seed_id=3)
model = dfr_sgl(X = data$X, y = data$y, groups = groups, alpha = 0.95)
where X
is the input matrix, y
the response vector, groups
a vector containing indices for the groups of the predictors, and alpha
determines the convex balance between the lasso and group lasso.
The impact of screening can be seen by turning off the screening rules:
no_screen = system.time(model <- dfr_sgl(X = data$X, y = data$y, groups = groups, alpha = 0.95,screen=FALSE))
screen = system.time(model_screen <- dfr_sgl(X = data$X, y = data$y, groups = groups, alpha = 0.95,screen=TRUE))
c(no_screen[3], screen[3])

library(dfr)
groups = c(rep(1:20, each=3),
rep(21:40, each=4),
rep(41:60, each=5),
rep(61:80, each=6),
rep(81:100, each=7))
data = sgs::gen_toy_data(p=500, n=400, groups = groups, seed_id=3)
model = dfr_adap_sgl(X = data$X, y = data$y, groups = groups, alpha = 0.95, gamma_1 = 0.1, gamma_2 = 0.1)
where gamma_1
and gamma_2
determine the shape of the adaptive penalties. Again, we can see the impact of screening
no_screen = system.time(model <- dfr_adap_sgl(X = data$X, y = data$y, groups = groups, alpha = 0.95, gamma_1 = 0.1, gamma_2 = 0.1, screen=FALSE))
screen = system.time(model_screen <- dfr_adap_sgl(X = data$X, y = data$y, groups = groups, alpha = 0.95, gamma_1 = 0.1, gamma_2 = 0.1, screen=TRUE))
c(no_screen[3], screen[3])
