Runs priorityelasticnet for a list of block specifications and gives the best results in terms of cv error.
cvm_priorityelasticnet(
X,
Y,
weights,
family,
type.measure,
blocks.list,
max.coef.list = NULL,
block1.penalization = TRUE,
lambda.type = "lambda.min",
standardize = TRUE,
nfolds = 10,
foldid,
cvoffset = FALSE,
cvoffsetnfolds = 10,
alpha = 1,
...
)object of class cvm_priorityelasticnet with the following elements. If these elements are lists, they contain the results for each penalized block of the best result.
lambda.indlist with indices of lambda for lambda.type.
lambda.typetype of lambda which is used for the predictions.
lambda.minlist with values of lambda for lambda.type.
min.cvmlist with the mean cross-validated errors for lambda.type.
nzerolist with numbers of non-zero coefficients for lambda.type.
glmnet.fitlist of fitted glmnet objects.
namea text string indicating type of measure.
block1unpenif block1.penalization = FALSE, the results of either the fitted glm or coxph object.
best.blockscharacter vector with the indices of the best block specification.
best.blocks.indiceslist with the indices of the best block specification ordered by best to worst.
best.max.coefvector with the number of maximal coefficients corresponding to best.blocks.
best.modelcomplete priorityelasticnet model of the best solution.
coefficientscoefficients according to the results obtained with best.blocks.
callthe function call.
A numeric matrix of predictors.
A response vector. For family = "multinomial", Y should be a factor with more than two levels.
Optional observation weights. Default is NULL.
A character string specifying the model type. Options are "gaussian", "binomial", "cox", and "multinomial". Default is "gaussian".
Loss function for cross-validation. Options are "mse", "deviance", "class", "auc". Default depends on the family.
list of the format list(list(bp1=...,bp2=...,), list(bp1=,...,bp2=...,), ...). For the specification of the entries, see priorityelasticnet.
list of max.coef vectors. The first entries are omitted if block1.penalization = FALSE. Default is NULL.
Logical. If FALSE, the first block will not be penalized. Default is TRUE.
Type of lambda to select. Options are "lambda.min" or "lambda.1se". Default is "lambda.min".
Logical flag for variable standardization, prior to fitting the model. Default is TRUE.
Number of folds for cross-validation. Default is 10.
Optional vector of values between 1 and nfolds identifying what fold each observation is in. Default is NULL.
Logical. If TRUE, a cross-validated offset is used. Default is FALSE.
Number of folds for cross-validation of the offset. Default is 10.
Elastic net mixing parameter. The elastic net penalty is defined as $$(1 - \alpha)/2||\beta||_2^2 + \alpha||\beta||_1$$ Defaults to 1 (lasso penalty).
other arguments that can be passed to the function priorityelasticnet.