Learn R Programming

uniLasso (Univariate guided Lasso)

Fits a univariate-guided sparse regression (lasso), by a two-stage procedure. The first stage fits p separate univariate models to the response. The second stage gives more weight to the more important univariate features, and preserves their signs. Conveniently, it returns an objects that inherits from class glmnet, so that all of the methods for glmnet are available. See doi:10.48550/arXiv.2501.18360 for details.

Installation

To install the uniLasso R package directly from github, run the following in R:

library(devtools)
install_github(repo="trevorhastie/uniLasso")

Copy Link

Version

Install

install.packages('uniLasso')

Version

2.11

License

GPL-2

Maintainer

Trevor Hastie

Last Published

January 26th, 2026

Functions in uniLasso (2.11)

plot.cv.uniReg

plot the cross-validation curve produced by cv.uniReg
polish.uniLasso

Fit a cross-validated univariate guided lasso model, followed by a lasso polish.
cv.uniLasso

Fit a cross-validated univariate guided lasso model.
simulate_uniLasso

Simulate data for use in uniLasso and uniReg
simulate_Gaussian

simulate Gaussian data
uniCoef

Compare the nonzero coefficients and univariate counterparts
print.cv.uniReg

print a cross-validated uniReg object
simulate_twoclass

simulate two class data
simulate_counterexample

simulate counterexample data
uniInfo

Create the univariate info for use in uniLasso
ci.uniReg

Compute bootstrap confidence intervals for a univariate guided regression model
predict.cv.uniReg

make predictions from a "cv.uniReg" object.