\HeaderA{mlbench.xor}{Continuous XOR Benchmark Problem}{mlbench.xor}
\keyword{datagen}{mlbench.xor}
\begin{Description}\relax
The inputs of the XOR problem are uniformly distributed on
the \code{d}-dimensional cube with corners \eqn{\{\pm 1\}}{\{+-1\}}. Each pair of
opposite corners form one class, hence the total number of classes is
\eqn{2^(d-1)}{}
\end{Description}
\begin{Usage}
\begin{verbatim}
mlbench.xor(n, d=2)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{n}] number of patterns to create
\item[\code{d}] dimension of the XOR problem
\end{ldescription}
\end{Arguments}
\begin{Value}
Returns an object of class \code{"mlbench.xor"} with components
\begin{ldescription}
\item[\code{x}] input values
\item[\code{classes}] factor vector of length \code{n} with target classes
\end{ldescription}
\end{Value}
\begin{Examples}
\begin{ExampleCode}
# 2d example
p<-mlbench.xor(300,2)
plot(p)
#
# 3d example
p<-mlbench.xor(300,3)
plot(p)
\end{ExampleCode}
\end{Examples}

