Predict categorical responses on new vector data given the fitted DSDA/MSDA model input.
# S3 method for msda
predict(object, newx, z = NULL, ztest = NULL, gamma = NULL,...)Fitted model object from msda. The model object can be anyone of binary, multi.original and multi.modified.
The matrix of new values for x at which predictions are
to be made. If covariates exist, then newx should be adjusted matrix.
Input training covariates matrix. z can be omitted if there is no covariate.
Input testing covariates matrix. ztest can be omitted if there is no covariate.
Coefficients of covariates obtained from adjvec. gamma is NULL if there is no covariate.
Other arguments that can be passed to predict.
Predicted class label(s) at the entire sequence of the penalty parameter lambda used to create the model.
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.
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.
# NOT RUN {
data(GDS1615)
x<-GDS1615$x
y<-GDS1615$y
obj <- msda(x = x, y = y)
pred<-predict(obj,x)
# }
Run the code above in your browser using DataLab