Learn R Programming

sprm (version 1.2.2)

predict.sprmda: Predict method for models of class sprmda

Description

Predictions from SPRM-DA classification model.

Usage

"predict"(object, newdata, ...)

Arguments

object
object of class sprmda.
newdata
optional data frame with new observations.
...
further arguments. Currently not used.

Value

predict.sprmda returns a vector of the predicted classmembership.

Details

If newdata is specified the SPRM-DA model is used to predict the fitted values for this data set, otherwise the fitted values of the model are returned.

References

Hoffmann, I., Filzmoser, P., Serneels, S., Varmuza, K., Sparse and robust PLS for binary classification.

See Also

sprmda, sprmdaCV

Examples

Run this code
data(iris)
data <- droplevels(subset(iris,iris$Species!="setosa"))
smod <- sprmda(Species~.,data, a=2, eta=0.5, class="lda")
table(data$Species, predict(smod))

Run the code above in your browser using DataLab