Grid search, true to its name, picks out a grid of hyperparameter values, evaluates every one of them, and returns the winner. For example, if the hyperparameter is the number of leaves in a decision tree, then the grid could be 10, 20, 30, …, 100. For regularization parameters, it’s common to use exponential scale: 1e-5, 1e-4, 1e-3, …, 1.
cv.ncvreg 3 cv.ncvreg Cross-validation for ncvreg Description Performs k-fold cross validation for MCP- or SCAD-penalized regression models over a grid of values for the regularization parameter lambda. Usage cv.ncvreg(X, y, ..., nfolds=10, seed, trace=FALSE) Arguments X The design matrix, without an intercept, as in ncvreg.