Description Usage Arguments Value
Cross-validation for lasso
1 2  | 
x | 
 predictors  | 
y | 
 response  | 
wt | 
 weights for the coefficients of weighted LASSO. Defaults to NULL  | 
ts | 
 stepsize for proximal gradient and sub-gradient method (use opt_ts() to generate stepsize). Defaults to NULL  | 
method | 
 lasso optimization function. Three different methods are available to use. method = c(lasso_cd, lasso_sg, lasso_pg). Defaults to lasso_cd  | 
k | 
 number of fold. Default value is 5.  | 
n_it | 
 number of iteration for lasso_cd method. Default value is 10.  | 
df | 
 Degree of freedom. Number of desired variables to be zero. Defaults to NULL  | 
The function returns the following list of outputs
model | 
 The values of coefficients corresponding to each lambda  | 
error | 
 Mean-squared error of the cross-validated model corresponding to each lambda  | 
coeff | 
 The values of coefficients corresponding to minimum mean-squared error  | 
index | 
 Index of the minimum mean-squared error (for internal use)  | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.