Description Usage Arguments Value Author(s) Examples
Returns predictions of the (O)PLS(-DA) model on a new dataset
1 2 |
object |
An S4 object of class |
newdata |
Either a data frame or a matrix, containing numeric columns only, with the same number of columns (variables) as the 'x' used for model training with 'opls'. |
... |
Currently not used. |
Predictions (either a vector, factor, or matrix depending on the y response used for training the model)
Etienne Thevenot, etienne.thevenot@cea.fr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | data(sacurine)
attach(sacurine)
predictorMN <- dataMatrix
responseFc <- sampleMetadata[, "gender"]
sacurine.plsda <- opls(predictorMN,
responseFc,
subset = "odd")
trainVi <- getSubsetVi(sacurine.plsda)
table(responseFc[trainVi], fitted(sacurine.plsda))
table(responseFc[-trainVi],
predict(sacurine.plsda, predictorMN[-trainVi, ]))
detach(sacurine)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.