View source: R/scores_glmnet.R
| scores_glmnet | R Documentation |
glmnet modelThe glmnet package does not provide a way to rank variants.
Here is implemented one possible ranking based on when a variable is first selected as the penalty factor lambda of glmnet is varied.
glmnet precomputes coefficients at a series of lambda knots, which are used for this score calculation.
This approach requires sparsity (does not work for ridge regression).
scores_glmnet(beta)
beta |
The matrix of coefficients (component |
The score vector.
Each locus receives a score between 0 and k (number of columns of beta).
Loci that were never selected have zero scores.
Loci first selected in column i have scores of k + 1 - i, so loci selected earlier have higher scores.
anova_glmnet() for a different way of scoring/raking variants.
## Not run: scores <- scores_glmnet( beta ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.