predict.glmpath {glmpath} | R Documentation |
Makes predictions at particular points along the fitted glmpath
Description
This function makes predictions at particular points along the fitted
glmpath.
The linear predictor, estimated response,
log-likelihood, or the coefficients can be computed.
Usage
## S3 method for class 'glmpath'
predict(object, newx, newy, s, type = c("link", "response",
"loglik", "coefficients"), mode = c("step",
"norm.fraction", "norm", "lambda.fraction", "lambda"),
weight = NULL, offset = NULL,
eps = .Machine$double.eps, ...)
Arguments
object |
a |
newx |
a matrix of features at which the predictions are made. If
|
newy |
a vector of responses corresponding to |
s |
the values of |
type |
If |
mode |
what |
weight |
an optional vector of weights for observations. |
offset |
If |
eps |
an effective zero |
... |
other options for the prediction |
Author(s)
Mee Young Park and Trevor Hastie
References
Mee Young Park and Trevor Hastie (2007) L1 regularization path algorithm for generalized linear models. J. R. Statist. Soc. B, 69, 659-677.
See Also
cv.glmpath, glmpath, plot.glmpath
Examples
data(heart.data)
attach(heart.data)
fit <- glmpath(x, y, family=binomial)
pred <- predict(fit, x, s = seq(0, 1, length=10), mode="norm.fraction")
detach(heart.data)