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

Description Usage Arguments Details Value See Also Examples

View source: R/osqda.R

Description

Classify multivariate observations in conjunction with osqda.

Usage

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

Arguments

object

Object of class "osqda".

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 osqda object.

...

Further arguments.

Details

This function is a method for the generic function predict() for class "osqda". It can be invoked by calling predict(x) for an object x of the appropriate class, or directly by calling predict.osqda(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

osqda.

Other observation_specific qda: osqda

Examples

1
2
3
4
       fit <- osqda(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.