Learn R Programming

msda (version 1.0.3)

predict.msda: make predictions from a "msda" object.

Description

This functions predicts class labels from a fitted msda object.

Usage

# S3 method for msda
predict(object, newx, ...)

Value

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

Arguments

object

fitted msda model object.

newx

matrix of new values for x at which predictions are to be made. NOTE: newx must be a matrix, predict function does not accept a vector or other formats of newx.

...

Not used. Other arguments to predict.

Author

Qing Mai <mai@stat.fsu.edu>, Yi Yang <yi.yang6@mcgill.ca>, Hui Zou <hzou@stat.umn.edu>
Maintainer: Yi Yang <yi.yang6@mcgill.ca>

References

Mai, Q.*, Yang, Y.*, and Zou, H. (2014), "Multiclass Sparse Discriminant Analysis." Submitted to Journal of the American Statistical Association. (* co-first author)

URL: https://github.com/emeryyi/msda

See Also

msda

Examples

Run this code
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