predict.cv.relaxnet: Predict Methods for cv.relaxnet and cv.alpha.relaxnet Objects

Description Usage Arguments Value Author(s) See Also

Description

Similar to other predict methods, this functions predicts fitted values, logits, coefficients and more from a fitted "cv.relaxnet" or "cv.alpha.relaxnet" object. By default, predictions are made at those values of the tuning parameters which "won" the cross-validation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## S3 method for class 'cv.relaxnet'
predict(object,
        newx,
        which.model = object$which.model.min,
        s = object$overall.lambda.min,
        type = c("link", "response", "coefficients", "nonzero", "class"),
        exact = FALSE,
        ...)

## S3 method for class 'cv.alpha.relaxnet'
predict(object,
        newx,
        alpha.val = object$which.alpha.min,
        type = c("link", "response", "coefficients", "nonzero", "class"),
        ...)

Arguments

object

The object from which predictions are to be made.

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")

alpha.val

Value of alpha at which predictions are to be made. Default is to use that value which "won" the cross-validation.

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. Default for both functions is to use the submodel which "won" the cross-validation.

s

Value(s) of the penalty parameter lambda at which predictions are required. Default for both functions is to use that value which "won" the cross-validation.

type

See link[glmnet]{predict.glmnet}.

exact

Only the default, FALSE, is supported. See link[glmnet]{predict.glmnet}.

...

Further arguments passed to predict.relaxnet or to predict.cv.relaxnet (for the alpha version).

Value

The object returned depends on type.

Author(s)

Stephan Ritter, with design contributions from Alan Hubbard.

Much of the code (and some help file content) is adapted from the glmnet package, whose authors are Jerome Friedman, Trevor Hastie and Rob Tibshirani.

See Also

relaxnet, cv.relaxnet, cv.alpha.relaxnet, predict.relaxnet, predict.glmnet


relaxnet documentation built on May 2, 2019, 12:39 p.m.