l_CV | R Documentation |
the function realizes K-Fold Cross validation for ridge/Lasso regression to help to choose the lambda that minimise the RSS
l_CV(data,y,x,lambda,k,mode=2,binary=FALSE,step=1000,bound=0.5,fista=TRUE,tol=10^-7)
data |
name of the dataset |
y |
name of the dependent variables |
x |
name of the independent variable |
lambda |
a number or a vector of lambda-value to be evaluated in the regression |
k |
integer, which indicates how many training and test set will be splited from the dataset |
mode |
1: ridge regression; 2: lasso regression |
binary |
logical, if TRUE, the dependent variable is binary |
step |
maximum number of steps |
bound |
threshold for binary dependent variable |
fista |
logical, if TRUE, the FISTA algorithm is used |
tol |
tolerance for convergence, it is 10^-7 by default |
the lambda values that minimize the MSE
l_CV(mtcars,"hp",c("mpg","qsec","disp"),c(0.01,0.1),k=5,mode=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.