sparselink {sparselink} | R Documentation |
Sparse regression for related problems
Description
Estimates sparse regression models (i.e., performing feature selection) in multi-task learning or transfer learning. Multi-task learning involves multiple targets, and transfer learning involves multiple datasets.
Usage
sparselink(
x,
y,
family,
alpha.init = 0.95,
alpha = 1,
type = "exp",
nfolds = 10,
cands = NULL
)
Arguments
x |
|
y |
|
family |
character |
alpha.init |
elastic net mixing parameter for initial regressions, default: 0.95 (lasso-like elastic net) |
alpha |
elastic net mixing parameter of final regressions, default: 1 (lasso) |
type |
default |
nfolds |
number of internal cross-validation folds, default: 10 (10-fold cross-validation) |
cands |
candidate values for both scaling parameters,
default: |
Value
Returns an object of class sparselink
, a list with multiple slots:
Stage 1 regressions (before sharing information): Slot
glm.one
containsq
objects of typecv.glmnet
(one for each problem).Candidate scaling parameters (exponents): Slot
weight
contains a data frame withn
combinations of exponents for the external (source) and internal (target) weightsStage 2 regressions (after sharing information): Slot
glm.two
containsq
lists (one for each problem) ofn
objects of typecv.glmnet
(one for each combination of exponents).Optimal regularisation parameters: Slot
lambda.min
contains the cross-validated regularisation parameters for the stage 2 regressions.Optimal scaling parameters: Slots
weight.ind
andweight.min
indicate or contain the cross-validated scaling parameters.
References
Armin Rauschenberger, Petr N. Nazarov, and Enrico Glaab (2025). "Estimating sparse regression models in multi-task learning and transfer learning through adaptive penalisation". Under revision. https://hdl.handle.net/10993/63425
See Also
Use coef
to extract coefficients
and predict
to make predictions.
Examples
#--- multi-task learning ---
n <- 100
p <- 200
q <- 3
family <- "gaussian"
x <- matrix(data=rnorm(n=n*p),nrow=n,ncol=p)
y <- matrix(data=rnorm(n*q),nrow=n,ncol=q)
object <- sparselink(x=x,y=y,family=family)
#--- transfer learning ---
n <- c(100,50)
p <- 200
x <- lapply(X=n,function(x) matrix(data=stats::rnorm(n*p),nrow=x,ncol=p))
y <- lapply(X=n,function(x) stats::rnorm(x))
family <- "gaussian"
object <- sparselink(x=x,y=y,family=family)