lasso_cv_search | R Documentation |
Search for optimal lambda via cross-validation
lasso_cv_search(
x,
y,
tau = 0.5,
weights = NULL,
method = "two_pass",
intercept = TRUE,
nfolds = 10,
foldid = NULL,
nlambda = 100,
eps = 1e-04,
init.lambda = 2,
parallel = T,
coef.cutoff = 1e-05,
thresh = 0.01,
...
)
x |
design matrix for regression |
y |
outcome variable for regression |
tau |
target quantile |
weights |
optional weights for regression |
method |
method to be used for penalized quantile regression (usually one of "sfn" or "br") |
intercept |
Whether to model the intercept or not |
nfolds |
number of folds to use for crossvalidation |
foldid |
optional pre-specified fold identifier (for example, if you want the folds to satisfy underlying data groupings) |
nlambda |
number of lambdas to search over |
eps |
smallest lambda used in search |
init.lambda |
initial lambda for search |
parallel |
whether to run cv scoring in parallel or not |
coef.cutoff |
what cutoff to use for "0" coefficients |
thresh |
threshhold for what counts as a "sparse enough" solution for the top of the grid |
... |
other parameters to pass on to fitting method |
Searches for a range of lambdas by first expanding the max lambda if necessary, then finding the smallest lambda that sets all coefficients to zero. Then it computes kfold CV scores along a grid of lambdas, returning the scores and the smallest lambda.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.