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

predict.loclda

Localized Linear Discriminant Analysis (LocLDA)


Description

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

Usage

## S3 method for class 'loclda'
predict(object, newdata, ...)

Arguments

object

Object of class loclda.

newdata

Data frame of cases to be classified.

...

Further arguments are ignored.

Value

A list with components:

class

Vector (of class factor) of classifications.

posterior

Posterior probabilities for the classes. For details of computation see loclda (+ normalization so posterior-values add up to 1 for each observation).

all.zero

Vector (of class integer) indicating for which rows of newdata all corresponding posterior-values are < 1e-150 before normalization. Those observations are assigned to the class to whose (locally weighted) centroid they have the lowest euclidian distance.

Author(s)

Marc Zentgraf (marc-zentgraf@gmx.de) and Karsten Luebke (karsten.luebke@fom.de)

See Also

Examples

data(B3)
x <- loclda(PHASEN ~ ., data = B3, subset = 1:80)
predict(x, B3[-(1:80),])

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.