Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.rda

Regularized Discriminant Analysis (RDA)


Description

Classifies new observations using parameters determined by the rda-function.

Usage

## S3 method for class 'rda'
predict(object, newdata, posterior = TRUE, 
    aslist = TRUE, ...)

Arguments

object

Object of class rda.

newdata

Data frame (or matrix) of cases to be classified.

posterior

Logical; indicates whether a matrix of posterior probabilites over all classes for each observation shall be returned in addition to classifications.

aslist

Logical; if TRUE, a list containing classifications and posterior probabilities is returned, otherwise a vector with an attribute ‘posterior’.

...

currently unused

Value

Depends on the value of argument ‘aslist’:

Either a vector (of class factor) of classifications that (optionally) has an attribute ‘posterior’ containing the posterior probability matrix, or

A list with elements ‘class’ and ‘posterior’.

Author(s)

See Also

Examples

data(iris)
x <- rda(Species ~ ., data = iris, gamma = 0.05, lambda = 0.2)
predict(x, iris[, 1:4])

klaR

Classification and Visualization

v0.6-15
GPL-2 | GPL-3
Authors
Christian Roever, Nils Raabe, Karsten Luebke, Uwe Ligges, Gero Szepannek, Marc Zentgraf, David Meyer
Initial release
2020-02-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.