Description Usage Arguments Details Value See Also Examples
predict.xtune
produces predicted values fitting an xtune model to a new dataset
1 2 3 |
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 |
X |
Passing arguments |
Y |
Passing arguments |
... |
Not used |
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
.
A vector of predictions
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.