Usage
"predict"(object, X, type = c("link", "response", "class", "coefficients", "vars", "groups", "nvars", "ngroups", "norm"), latent = FALSE, lambda, which = 1:length(object$lambda), ...)
"predict"(object, X, type = c("link", "response", "class", "coefficients", "vars", "groups", "nvars", "ngroups", "norm"), latent = FALSE, lambda = object$lambda.min, which=object$min, ...)
"coef"(object, lambda, latent = FALSE, which=1:length(object$lambda), drop=TRUE, ...)
"coef"(object, latent = FALSE, lambda = object$lambda.min, which = object$min, ...)
Arguments
object
A fitted "grpregOverlap"
or "cv.grpregOverlap"
model object.
X
Matrix of values at which predictions are to be made. Not used for type="coefficients"
.
type
Type of prediction: "link"
returns the linear predictors; "response"
gives the fitted values; "class"
returns the binomial outcome with the highest probability; "coefficients"
returns the coefficients; "vars"
returns the indices for the nonzero coefficients; "groups"
returns the indices for the groups with at least one nonzero coefficient; "nvars"
returns the number of nonzero coefficients; "ngroups"
returns the number of groups with at least one nonzero coefficient; "norm"
returns the L2 norm of the coefficients in each group.
latent
Should return prediction values at the latent level? Default is FALSE. The option latent = TRUE
is meaningful only if type
is "coefficients", "vars", "nvars", or "norm" since there are no latent information for other types. Otherwise, a note message will be printed; If type = "norm"
, this argument is overwritten to be 'TRUE' since the L2 norms are from latent coefficients.
lambda
Values of the regularization parameter lambda
at which predictions are requested. For values of lambda
not in the sequence of fitted models, linear interpolation is used.
which
Indices of the penalty parameter lambda
at which predictions are required. By default, all indices are returned. If lambda
is specified, this will override which
.
drop
Drop the matrix to be a vector.