| predict.specproc_robust_da | R Documentation |
Predicts the classes, or the posterior probabilities of the classes, of
new observations with a model fitted by robust_da().
## S3 method for class 'specproc_robust_da'
predict(object, newdata, type = c("class", "prob"), ...)
object |
An object returned by |
newdata |
A numeric matrix or data frame with the same variables as the training data. |
type |
|
... |
Not used. |
With type = "class", a factor of the predicted classes. With
type = "prob", a tibble with one column of posterior probabilities
per class.
Christian L. Goueguel
robust_da()
# iris: train on 100 flowers, predict the 50 others
set.seed(1)
train <- sample(nrow(iris), 100)
fit <- robust_da(iris[train, 1:4], iris$Species[train], method = "quadratic")
head(predict(fit, iris[-train, 1:4]))
head(predict(fit, iris[-train, 1:4], type = "prob"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.