Generalized Dantzig Selector with cross-validation.
cv_gds(
X,
y,
family = "gaussian",
no_lambda = 10,
lambda = NULL,
n_folds = 5,
weights = rep(1, length(y))
)
An object of class cv_gds
.
Design matrix.
Vector of the continuous response value.
Use "gaussian" for linear regression, "binomial" for logistic regression and "poisson" for Poisson regression.
Length of the vector lambda
of regularization
parameters. Note that if lambda
is not provided, the actual number
of values might differ slightly, due to the algorithm used by
glmnet::glmnet
in finding a grid of lambda
values.
Regularization parameter. If not supplied and if
no_lambda > 1
, a sequence of no_lambda
regularization
parameters is computed with glmnet::glmnet
. If no_lambda = 1
then the cross-validated optimum for the lasso is computed using
glmnet::cv.glmnet
.
Number of cross-validation folds to use.
A vector of weights for each row of X
. Defaults to 1
per observation.
Cross-validation loss is calculated as the deviance of the model divided
by the number of observations.
For the Gaussian case, this is the mean squared error. Weights supplied
through the weights
argument are used both in fitting the models
and when evaluating the test set deviance.
candes2007hdme
james2009hdme