lasso: Fit LASSO Regression with Transfer Learning

View source: R/4_lasso.R

lassoR Documentation

Fit LASSO Regression with Transfer Learning

Description

Fits a LASSO (Least Absolute Shrinkage and Selection Operator) regression model under a transfer learning framework. Supports feature selection and coefficient estimation by combining target data and source data.

Usage

lasso(target, source = NULL, transfer = FALSE, lambda = "lambda.1se")

Arguments

target

A list containing two elements:

  • x: Feature matrix of target data (numeric matrix)

  • y: Response vector of target data (numeric vector)

Required.

source

A list (optional, default: NULL) containing two elements:

  • x: Feature matrix of source data (numeric matrix)

  • y: Response vector of source data (numeric vector)

Used when transfer = TRUE.

transfer

A logical value (default: FALSE) indicating whether to enable transfer learning mode (combine source data with target data).

lambda

A string (default: 'lambda.1se') specifying the criterion for selecting regularization parameter:

  • 'lambda.min': Lambda value that gives minimum cross-validation error

  • 'lambda.1se': Largest lambda value within 1 standard error of the minimum error

Value

A numeric vector coef containing LASSO coefficient estimates (including intercept).


TransHDM documentation built on Nov. 24, 2026, 9:06 a.m.