predict.oslda: Classify Multivariate Observations Based on Observation...

Description Usage Arguments Details Value See Also Examples

View source: R/oslda.R

Description

Classify multivariate observations in conjunction with oslda.

Usage

1
predict.oslda(object, newdata, ...)

Arguments

object

Object of class "oslda".

newdata

A data.frame of cases to be classified or, if object has a formula, a data.frame with columns of the same names as the variables used. A vector will be interpreted as a row vector. If newdata is missing, an attempt will be made to retrieve the data used to fit the oslda object.

...

Further arguments.

Details

This function is a method for the generic function predict() for class "oslda". It can be invoked by calling predict(x) for an object x of the appropriate class, or directly by calling predict.oslda(x) regardless of the class of the object.

Value

A list with components:

class

The predicted class labels (a factor).

posteriors

Matrix of class posterior probabilities.

See Also

oslda.

Other observation_specific lda: oslda

Examples

1
2
3
4
      fit <- oslda(Species ~ Sepal.Length + Sepal.Width, data = iris,
                   wf = "gaussian", bw = 0.5, method = "ML")
     pred <- predict(fit)
     mean(pred$class != iris$Species)

schiffner/locClass documentation built on May 29, 2019, 3:39 p.m.