Description Usage Arguments Details Value Author(s) See Also Examples
Similar to other predict methods, this function returns predictions from a fitted
"grpregOverlap"
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## S3 method for class 'grpregOverlap'
predict(object, X, type = c("link", "response", "class",
"coefficients", "vars", "groups", "nvars", "ngroups", "norm"), latent = FALSE,
lambda, which = 1:length(object$lambda), ...)
## S3 method for class 'cv.grpregOverlap'
predict(object, X, type = c("link", "response", "class",
"coefficients", "vars", "groups", "nvars", "ngroups", "norm"), latent = FALSE,
lambda = object$lambda.min, which=object$min, ...)
## S3 method for class 'grpregOverlap'
coef(object, lambda, latent = FALSE, which=1:length(object$lambda), drop=TRUE, ...)
## S3 method for class 'cv.grpregOverlap'
coef(object, latent = FALSE, lambda = object$lambda.min, which = object$min, ...)
|
object |
A fitted |
X |
Matrix of values at which predictions are to be made. Not used for |
type |
Type of prediction: |
latent |
Should return prediction values at the latent level? Default is FALSE. The option |
lambda |
Values of the regularization parameter |
which |
Indices of the penalty parameter |
drop |
Drop the matrix to be a vector. |
... |
Not used. |
coef
and predict
methods are provided for "cv.grpregOverlap"
options as a convenience. They simply call coef.grpregOverlap
and predict.grpregOverlap
with lambda
set to the value that minimizes the cross-validation error.
The object returned depends on the specification on type
and latent
.
Yaohui Zeng and Patrick Breheny
Maintainer: Yaohui Zeng <yaohui-zeng@uiowa.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(pathway.dat)
X <- pathway.dat$expression
group <- pathway.dat$pathways
y <- pathway.dat$mutation
fit <- grpregOverlap(X, y, group, penalty = 'grLasso', family = 'binomial')
head(predict(fit, type = 'ngroups', lambda = 0.01))
head(predict(fit, type = 'nvars', lambda = 0.01))
head(predict(fit, type = 'vars', latent = TRUE, lambda = 0.01))
head(predict(fit, type = 'groups', latent = TRUE, lambda = 0.01)) # A note printed.
head(predict(fit, X, type="class", lambda=.01))
head(predict(fit, X, type = "coefficients", lambda = 0.01))
head(predict(fit, type="norm", lambda=.01))
## Not run:
cvfit <- cv.grpregOverlap(X, y, group, penalty = 'grLasso', family = 'binomial')
head(coef(cvfit))
predict(cvfit, X, type='response')
predict(cvfit, X, type = 'link')
predict(cvfit, X, type = 'class')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.