Package: ptLasso 1.0.2

Erin Craig

ptLasso: Pretraining the Lasso

Implements lasso pretraining for generalized linear models for data with grouped observations; data without grouped observations, but with multinomial responses; data with multiple Gaussian responses; and data with repeated measurements over time. The method fits a lasso model to an initial dataset and then uses its support and coefficient values to guide model fitting for a related task, which can improve performance by leveraging larger datasets and preserve interpretability by identifying features which are generally shared, and which are task specific. See Craig et al. (2026) <doi:10.1093/jrsssb/qkaf050> for details. Model fitting in this package is done with cv.glmnet() from the 'glmnet' package, and syntax closely follows that of 'glmnet' (Friedman, Hastie and Tibshirani (2010) <doi:10.18637/jss.v033.i01>).

Authors:Erin Craig [aut, cre, cph], Rob Tibshirani [aut, cph]

ptLasso_1.0.2.tar.gz
ptLasso_1.0.2.zip(r-4.7-any)ptLasso_1.0.2.zip(r-4.6-any)
ptLasso_1.0.2.tar.gz(r-4.7-any)ptLasso_1.0.2.tar.gz(r-4.6-any)
ptLasso_1.0.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
ptLasso/json (API)

# Install 'ptLasso' in R:
install.packages('ptLasso', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/erincr/ptlasso/issues

Pkgdown/docs site:https://erincr.github.io

On CRAN:

Conda:

2.70 score 9 scripts 9 exports 28 dependencies

Last updated from:9261ccbc1b. Checks:4 WARNING, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64WARNING239
source / vignettesOK273
linux-release-x86_64WARNING192
windows-devel-x86_64WARNING135
windows-release-x86_64WARNING148
wasm-releaseOK93

Exports:binomial.example.datacv.ptLassogaussian.example.dataget.individual.supportget.overall.supportget.pretrain.supportmakedatamakedata.targetgroupsptLasso

Dependencies:clicodetoolscpp11farverforeachggplot2glmnetgluegridExtragtableisobanditeratorslabelinglatticelifecycleMatrixR6RColorBrewerRcppRcppEigenrlangS7scalesshapesurvivalvctrsviridisLitewithr

Input grouped data
Base case: input grouped data with a binomial outcome | Base case: input grouped survival data

Last update: 2026-10-27
Started: 2026-10-27

Multi-response data with Gaussian responses

Last update: 2026-10-27
Started: 2026-10-27

ptLasso Vignette and Manual
Introduction to pretraining | Review of the lasso | Details of pretraining | ptLasso under the hood | Quick start | ptLasso uses the same syntax as glmnet | An example | Other details | Choosing $\alpha$, the pretraining parameter | Choosing $\lambda$, the lasso path parameter, for the first stage of pretraining | Fitting elasticnet or ridge models | Printing progress during model training | Using individual and overall models that were previously trained | Fitting the overall model without group-specific intercepts | Arguments for use in cv.glmnet | Parallelizing model fitting | More pretraining! | References

Last update: 2026-10-27
Started: 2026-10-27

Target grouped or multinomial reponse data
Intuition | Example

Last update: 2026-10-27
Started: 2026-10-27

Time series data
Example 1: covariates are constant over time | Example 2: covariates change over time

Last update: 2026-10-27
Started: 2026-10-27