# predict.rrlda

From rrlda v1.1
by Moritz Gschwandtner

##### Class Prediction for rrlda objects

Computes class predictions for new data based on a given rrlda object.

- Keywords
- file

##### Usage

`"predict"(object, x, ...)`

##### Arguments

- object
- An object of class "rrlda".
- x
- New data for which the classes are to predict
- ...
- Argument used by generic function predict(object, x, ...).

##### Details

Based on the estimated inverse covariance matrix and the mean of each group (stored in object), discriminant values are computed. An observations is classified as group k, if the corresponding discriminant value is a minimum.

##### Value

- class
- Class prediction for each observation.
- posterior
- Discriminant values.

##### Examples

```
data(iris)
x <- iris[,1:4]
rr <- rrlda(x, grouping=as.numeric(iris[,5]), lambda=0.2, hp=0.75) ## perform rrlda
pred <- predict(rr, x) ## predict
table(as.numeric(pred$class), as.numeric(iris[,5])) ## show errors
```

*Documentation reproduced from package rrlda, version 1.1, License: GPL (>= 3)*

### Community examples

Looks like there are no examples yet.