View source: R/cssr_old.R View source: R/cssr.R
getLassoLambda | R Documentation |
Chooses a lambda value for the lasso by cross-validation.
getLassoLambda(X, y, lambda_choice = "1se", nfolds = 10)
X |
An n x p numeric matrix (preferably) or a data.frame (which will be coerced internally to a matrix by the function model.matrix) containing the p >= 2 features/predictors that will be used by cluster stability selection. |
y |
The response; an n-dimensional numeric vector. |
lambda_choice |
Character; either "min" or "1se". If "min", chooses the lambda that minimizes the cross-validated error; if "1se", chooses the largest lambda within one standard error of the minimum error lambda (resulting in a smaller selected set, which may be desirable because the model size corresponding to the minimum error lambda tends to be larger than optimal. See, for example, Bühlmann and Meinshausen 2006, Prop. 1 and Bühlmann and van de Geer 2011, Section 2.5.1.). Default is "1se". |
nfolds |
Numeric or integer; the number of folds for cross-validation. Must be at least 4 (as specified by cv.glmnet). Default is 10. |
A numeric; the selected value of lambda.
Gregory Faletto, Jacob Bien
Bühlmann, P., & Meinshausen, N. (2006). High-Dimensional Graphs
and Variable Selection With the Lasso. The Annals of Statistics,
34(3), 1436–1462. https://doi.org/10.1214/009053606000000281.
Peter Bühlmann and Sara van de Geer. Statistics for High-Dimensional
Data. Springer Series in Statistics. Springer, Heidelberg, 2011. ISBN
978-3-642-20191-2. http://dx.doi.org/10.1007/978-3-642-20192-9.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.