cv_lasso: Cross-validated Lasso on Indicator Bases

Description Usage Arguments

View source: R/cv_lasso.R

Description

Fits the Lasso regression using a customized procedure, with cross-validation based on origami

Usage

1
cv_lasso(x_basis, y, n_lambda = 100, n_folds = 10, center = FALSE)

Arguments

x_basis

A dgCMatrix object corresponding to a sparse matrix of the basis functions generated for the HAL algorithm.

y

A numeric vector of the observed outcome variable values.

n_lambda

A numeric scalar indicating the number of values of the L1 regularization parameter (lambda) to be obtained from fitting the Lasso to the full data. Cross-validation is used to select an optimal lambda (that minimizes the risk) from among these.

n_folds

A numeric scalar for the number of folds to be used in the cross-validation procedure to select an optimal value of lambda.

center

binary. If TRUE, covariates are centered. This is much slower, but matches the glmnet implementation. Default FALSE.


jeremyrcoyle/mangolassi documentation built on Dec. 2, 2019, 10:42 p.m.