\HeaderA{bayesclass}{Bayes classifier}{bayesclass}
\aliasA{bayesclass.mlbench.2dnormals}{bayesclass}{bayesclass.mlbench.2dnormals}
\aliasA{bayesclass.mlbench.cassini}{bayesclass}{bayesclass.mlbench.cassini}
\aliasA{bayesclass.mlbench.circle}{bayesclass}{bayesclass.mlbench.circle}
\aliasA{bayesclass.mlbench.cuboids}{bayesclass}{bayesclass.mlbench.cuboids}
\aliasA{bayesclass.mlbench.ringnorm}{bayesclass}{bayesclass.mlbench.ringnorm}
\aliasA{bayesclass.mlbench.threenorm}{bayesclass}{bayesclass.mlbench.threenorm}
\aliasA{bayesclass.mlbench.twonorm}{bayesclass}{bayesclass.mlbench.twonorm}
\aliasA{bayesclass.mlbench.xor}{bayesclass}{bayesclass.mlbench.xor}
\aliasA{bayesclass.noerr}{bayesclass}{bayesclass.noerr}
\keyword{classif}{bayesclass}
\begin{Description}\relax
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 \code{bayesclass.noerr} (which
simply returns \code{z\$classes} and is used for all problems with
disjunct classes).
\end{Description}
\begin{Usage}
\begin{verbatim}
bayesclass(z)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{z}] An object of class \code{"mlbench"}.
\end{ldescription}
\end{Arguments}
\begin{Examples}
\begin{ExampleCode}
# 6 overlapping classes
p <- mlbench.2dnormals(500,6)
plot(p)

plot(p$x, col=as.numeric(bayesclass(p)))
\end{ExampleCode}
\end{Examples}

