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

bayesclass

Bayes classifier


Description

Returns the decision of the (optimal) Bayes classifier for a given data set. This is a generic function, i.e., there are different methods for the various mlbench problems.

If the classes of the problem do not overlap, then the Bayes decision is identical to the true classification, which is implemented as the dummy function bayesclass.noerr (which simply returns z$classes and is used for all problems with disjunct classes).

Usage

bayesclass(z)

Arguments

z

An object of class "mlbench".

Examples

# 6 overlapping classes
p <- mlbench.2dnormals(500,6)
plot(p)

plot(p$x, col=as.numeric(bayesclass(p)))

mlbench

Machine Learning Benchmark Problems

v2.1-3
GPL-2
Authors
Friedrich Leisch and Evgenia Dimitriadou.
Initial release
2021-01-21

We don't support your browser anymore

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