Learn R Programming

relaxnet (version 0.3-2)

predict.relaxnet: Predict Method for "relaxnet" Objects

Description

Similar to other predict methods, this functions predicts fitted values, logits, coefficients and more from a fitted "relaxnet" object.

Usage

"predict"(object, newx, which.model, s = NULL, type = c("link", "response", "coefficients", "nonzero", "class"), exact = FALSE, ...)

Arguments

object
The "relaxnet" object from which to get predictions.
newx
Matrix of new values for x at which predictions are to be made. Must be a matrix; can be sparse as in Matrix package. This argument is not used for type=c("coefficients","nonzero")
which.model
Specifies the submodel from which predictions are required. "main" indicates the main glmnet model, while an integer indicates one of the relaxed models.
s
Value(s) of the penalty parameter lambda at which predictions are required. Default is the entire sequence of lambda values for the model specified by which.model.
type
See link[glmnet]{predict.glmnet}.
exact
Only the default, FALSE, is supported. See link[glmnet]{predict.glmnet}.
...
Further arguments passed to predict.glmnet. In the current version, these are not guaranteed to work correctly (for example, offset has not yet been implemented for relaxnet).

Value

The object returned depends on type.

See Also

relaxnet, predict.glmnet