Description Usage Arguments Value Examples
View source: R/cv_grid_lasso_logistic.R
Cross-validation wrapper for grid_lasso_logistic that computes solutions, selects and fits the optimal model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
x |
Design matrix, n x p. |
y |
Vector of responses, length n. |
K |
Number of folds for cross-validation. Must be at least 2 |
var_order |
For user-specified ordering of variables. Indices start at 0, start with least important variable and end with most. By default order will be induced from scaling of columns in design matrix |
lambda |
For user-specified sequence of tuning parameter lambda |
nlambda |
Length of automatically generated sequence of tuning parameters lambda |
grid.size |
Number of subsets of variables for which a solution path will be computed for |
lambda.min.ratio |
Ratio of max/min lambda for automatically generated sequence of tuning parameters lambda |
thresh |
Convergence threshold for coordinate descent for difference in objective values between successive iterations |
maxit |
Maximum number of iterations for coordinate descent routine |
mc.cores |
Number of cores to be made available for computing the cross-validation estimates in parallel |
return.full.beta |
Return the entire solution path for the chosen variable subset, as opposed to only the estimate for estimated optimal lambda |
silent |
Suppress some text to console |
fold_assign |
For user-specified vector of assignment of folds for cross-validation. Must be of the form of integer vector with entries in 1 , ... , K. |
A glmnet model object, with some additional attributes:
best – an index denoting which point on the path of lambda values is estimated optimal
cv – matrix of cross-validation error for each value of lambda and gridpoint
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.