lasso_cv_search.Rd
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,
...
)
design matrix for regression
outcome variable for regression
target quantile
optional weights for regression
method to be used for penalized quantile regression (usually one of "sfn" or "br")
Whether to model the intercept or not
number of folds to use for crossvalidation
optional pre-specified fold identifier (for example, if you want the folds to satisfy underlying data groupings)
number of lambdas to search over
smallest lambda used in search
initial lambda for search
whether to run cv scoring in parallel or not
what cutoff to use for "0" coefficients
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.