| predict.pda | R Documentation |
Classify new data based on a trained pda model.
## S3 method for class 'pda' predict(object, newdata = NULL, ...)
object |
A fitted |
newdata |
Matrix of predictor values. |
... |
Additional arguments to |
Based on the trained pda model, new data objects (rows of newdata) are
classified. Remember that pda does not scale the predictor matrix, make certain your
newdata are treated identically to the predictor matrix used to train the pda
model.
A list with one element for each dimension. In each element is another list with the integer
Dimension, the vector Classifications, the posterior probabilities Posteriors and
the PLS-scores Scores used to make the classifications.
Lars Snipen.
pda.
data(microbiome) y <- microbiome[1:40,1] X <- as.matrix(microbiome[1:40, -1]) p.trn <- pda(y[-1], X[-1,], prior = c(0.5,0.5), max.dim = 8) # leaving out sample 1 before training lst <- predict(p.trn, newdata = X[1, , drop = FALSE]) # predicting sample 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.