predict.xtune: Model predictions based on fitted 'xtune' object

Description Usage Arguments Details Value See Also Examples

Description

predict.xtune produces predicted values fitting an xtune model to a new dataset

Usage

1
2
3
## S3 method for class 'xtune'
predict(object, newX, type = c("response", "class"),
  X = NULL, Y = NULL, ...)

Arguments

object

Fitted 'xtune' model object.

newX

Matrix of values at which predictions are to be made.

type

Type of prediction required. For "linear" models it gives the fitted values. Type "response" gives the fitted probability scores for "binary" outcome. Type "class" applies only to "binary" models, and produces the class label corresponding to the maximum probability. Note that with type = "class", it is required to supply the original X = and Y = as additional arguments to predict().

X

Passing arguments X= when type = class

Y

Passing arguments Y= when type = class

...

Not used

Details

coef and predict methods are provided as a convenience to extract coefficients and make prediction. predict.xtune simply calculate the predicted value using the estimated coefficients returned by xtune.

Value

A vector of predictions

See Also

xtune, coef.xtune

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## simulate data
set.seed(9)
data(example)
X <- example$X
Y <- example$Y
Z <- example$Z

## If no Z provided, perform Empirical Bayes tuning
# fit.eb <- xtune(X,Y)
## Coef and predict methods
#coef(fit.eb)
# predict(fit.eb,X)

## Differential shrinkage based on external information Z:
fit.diff <- xtune(X,Y,Z)
## Coef and predict methods
coef(fit.diff)
predict(fit.diff,X)

xtune documentation built on May 24, 2019, 9:01 a.m.