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

classify

classify


Description

classifies data

Usage

classify(data, train, metric = "bayes")

Arguments

data

data to classify

train

training data

metric

bayes or mahal

Value

The classification matrix.

Author(s)

Jonathan Harrington

Examples

## The function is currently defined as
function (data, train, metric = "bayes") 
{
    probs <- distance(data, train, metric = metric)
    if (metric == "bayes") {
        best <- apply(probs, 1, max)
    }
    else if (metric == "mahal") {
        best <- apply(probs, 1, min)
    }
    result <- rep("", length(best))
    for (lab in 1:length(train$label)) {
        tmp <- probs[, lab] == best
        result[tmp] <- train$label[lab]
    }
    result
  }

emuR

Main Package of the EMU Speech Database Management System

v2.2.0
GPL (>= 2)
Authors
Raphael Winkelmann [aut, cre], Klaus Jaensch [aut, ctb], Steve Cassidy [aut, ctb], Jonathan Harrington [aut, ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.