classify

0th

Percentile

Classification function

Classify provided observations based on a given Discriminant object

Usage
classify(DA_object, newdata)
Arguments
DA_object
discriminant analysis object
newdata
vector or matrix or data frame with variables for which their classes will be calculated
Details

A DA_object is a discriminant analysis (DA) object obtained from a geometric predictive DA (class "geoda"), a linear DA (class "linda"), a quadratic DA (class "quada"), or a DISQUAL analysis (class "disqual")

Value

A list with the following elements
scores
discriminant scores for each observation
pred_class
predicted class

See Also

geoDA, linDA, quaDA, plsDA, disqual

Aliases
  • classify
Examples
## Not run: 
#   # load iris dataset
#   data(iris)
# 
#   # linear discriminant analysis
#   my_lin1 = linDA(iris[,1:4], iris$Species)
# 
#   # select a sample of 15 observations
#   set.seed(111)
#   obs = sample(1:nrow(iris), 15)
#   some_data = iris[obs, 1:4]
# 
#   # classify some_data
#   get_classes = classify(my_lin1, some_data)
#   get_classes
# 
#   # compare the results against original class
#   table(iris$Species[obs], get_classes$pred_class)
#   ## End(Not run)
Documentation reproduced from package DiscriMiner, version 0.1-29, License: GPL-3

Community examples

Looks like there are no examples yet.