predict.glmpath {glmpath} | R Documentation |
This function makes predictions at particular points along the fitted
glmpath.
The linear predictor, estimated response,
log-likelihood, or the coefficients can be computed.
## 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, ...)
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 |
Mee Young Park and Trevor Hastie
Mee Young Park and Trevor Hastie (2007) L1 regularization path algorithm for generalized linear models. J. R. Statist. Soc. B, 69, 659-677.
cv.glmpath, glmpath, plot.glmpath
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)