predict.msda: Predict categorical responses for vector data.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/predict.msda.R

Description

Predict categorical responses on new vector data given the fitted DSDA/MSDA model input.

Usage

1
2
## S3 method for class 'msda'
predict(object, newx, z = NULL, ztest = NULL, gamma = NULL,...)

Arguments

object

Fitted model object from msda. The model object can be anyone of binary, multi.original and multi.modified.

newx

The matrix of new values for x at which predictions are to be made. If covariates exist, then newx should be adjusted matrix.

z

Input training covariates matrix. z can be omitted if there is no covariate.

ztest

Input testing covariates matrix. ztest can be omitted if there is no covariate.

gamma

Coefficients of covariates obtained from adjvec. gamma is NULL if there is no covariate.

...

Other arguments that can be passed to predict.

Details

The function fits LDA model on selected discriminant vectors. Call predict or predict.msda to perform prediction. When covariates exist, users could first call adjvec to make adjustment and obtain obtain gamma. The fitted model from msda should also takes adjusted vector as input. The newx in predict.msda shoudl be adjusted vector as well.

Value

Predicted class label(s) at the entire sequence of the penalty parameter lambda used to create the model.

Author(s)

Yuqing Pan, Qing Mai, Xin Zhang

References

Mai, Q., Zou, H. and Yuan, M. (2012), "A direct approach to sparse discriminant analysis in ultra-high dimensions." Biometrica, 99, 29-42.

Mai, Q., Yang, Y., and Zou, H. (2017), "Multiclass sparse discriminant analysis." Statistica Sinica, in press.

Pan, Y., Mai, Q., and Zhang, X. (2018), "Covariate-Adjusted Tensor Classification in High-Dimensions." Journal of the American Statistical Association, accepted.

See Also

msda

Examples

1
2
3
4
5
data(GDS1615)
x<-GDS1615$x
y<-GDS1615$y
obj <- msda(x = x, y = y)
pred<-predict(obj,x)

TULIP documentation built on Jan. 13, 2021, 3:14 p.m.

Related to predict.msda in TULIP...