.glmnetRandomizedLasso | R Documentation |
This function performs randomized lasso using the glmnet
package. The function present in the stabs
package that runs the
lasso version was adapted for the randomized lasso here. Randomized
lasso stability selection uses this function repeatedly
to select predictors.
.glmnetRandomizedLasso(
x,
y,
q,
weakness = 1,
type = c("conservative", "anticonservative"),
...
)
x |
the predictor matrix. Passed to |
y |
the response vector. Passed to |
q |
the number of variables that are selected on each subsample.
Passed to |
weakness |
weakness parameter used in randomized lasso (see details). |
type |
parameter passed to |
... |
additional parameters for |
This function is identical to glmnet.lasso
from the
stabs
package. The only addition/modification is the weakness
parameter which has been added when calling the
glmnet
function by setting
penalty.factor = 1/runif(ncol(x), weakness, 1),
where ncol(x) is the number of predictors.
the regression output which consists of a list of length 2. The list contains the following:
- a logical vector of length equal to the total number of predictors. The predictors that were chosen have a value of TRUE.
- a logical matrix containing the regularization steps as columns and the predictors as rows. An entry of TRUE indicates selection.
glmnet.lasso
and glmnet
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.