blasso | R Documentation |
This function performs n glmnet::cv.glmnet(family = c("gaussian", "poisson"))
models using bootstrap validation and splitting the input data in train and test at each loop.
blasso( x, y, loops = 2, bootstrap = TRUE, alpha = 1, nfolds = 10, offset = NULL, family = "gaussian", ntest = NULL, seed = 987654321, ncores = 2 )
x |
x matrix as in glmnet. |
y |
Response variable. Should be numeric a vector. |
loops |
Number of loops (a |
bootstrap |
Logical indicating if bootstrap will be performed or not. |
alpha |
The elasticnet mixing parameter, with 0 ≤ alpha ≤ 1. alpha = 1 is the lasso penalty, and alpha = 0 the ridge penalty. |
nfolds |
Number of folds - default is 10. Although nfolds can be as large as the sample size (leave-one-out CV), it is not recommended for large datasets. Smallest value allowable is nfolds=3. |
offset |
A vector of length |
family |
Response type. Quantitative for family = "gaussian" or family = "poisson" (non-negative counts). |
ntest |
Numeric indicating the percentage of observations that will be used as test set. Default is NULL (no test set). |
seed |
|
ncores |
Number of cores. Each loop will run in one core using the |
A LassoLoop object with the results.
Pol Castellano-Escuder
Jerome Friedman, Trevor Hastie, Robert Tibshirani (2010). Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software, 33(1), 1-22. URL http://www.jstatsoft.org/v33/i01/.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.