\HeaderA{Planarplot}{Visualize Separability of different classes}{Planarplot}
\keyword{multivariate}{Planarplot}
\begin{Description}\relax
Given two variables, the methods trains a classifier
(argument \code{classifier}) based on these two variables
and plots the resulting class regions, learning- and test
observations in the plane.

Appropriate variables are usually found by \code{\LinkA{GeneSelection}{GeneSelection}}.

For S4 method information, s. \code{\LinkA{Planarplot-methods}{Planarplot.Rdash.methods}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
Planarplot(X, y, f, learnind, predind, classifier, gridsize = 100, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{X}] Gene expression data. Can be one of the following:
\Itemize{
\item A \code{matrix}. Rows correspond to observations, columns to variables.
\item A \code{data.frame}, when \code{f} is \emph{not} missing (s. below).
\item An object of class \code{ExpressionSet}.
}

\item[\code{y}] Class labels. Can be one of the following:
\Itemize{
\item A \code{numeric} vector.
\item A \code{factor}.
\item A \code{character} if \code{X} is an \code{ExpressionSet} that
specifies the phenotype variable.
\item \code{missing}, if \code{X} is a \code{data.frame} and a
proper formula \code{f} is provided.
}

\item[\code{f}] A two-sided formula, if \code{X} is a \code{data.frame}. The
left part correspond to class labels, the right to variables.
\item[\code{learnind}] An index vector specifying the observations that
belong to the learning set. May be \code{missing};
in that case, the learning set consists of all
observations and predictions are made on the
learning set.
\item[\code{predind}] A vector containing \emph{exactly} two indices that
denote the two variables used for classification.
\item[\code{classifier}] Name of function ending with \code{CMA} indicating
the classifier to be used.
\item[\code{gridsize}] The gridsize used for two-dimensional plotting.

For both variables specified in \code{predind},
an equidistant grid of size \code{gridsize} is created.
The resulting two grids are then combined to obtain
\code{gridsize\textasciicircum{}2} points in the real plane which are
used to draw the class regions. Defaults to 100
which is usually a reasonable choice, but takes
some time.
\item[\code{...}] Further argument passed to \code{classifier}.
\end{ldescription}
\end{Arguments}
\begin{Value}
No return.
\end{Value}
\begin{Author}\relax
Martin Slawski \email{martin.slawski@campus.lmu.de}

Anne-Laure Boulesteix \url{http://www.slcmsr.net/boulesteix}.
Idea is from the \code{MLInterfaces} package, contributed
by Jess Mar, Robert Gentleman and Vince Carey.
\end{Author}
\begin{SeeAlso}\relax
\code{GeneSelection},
\code{\LinkA{compBoostCMA}{compBoostCMA}}, \code{\LinkA{dldaCMA}{dldaCMA}}, \code{\LinkA{ElasticNetCMA}{ElasticNetCMA}},
\code{\LinkA{fdaCMA}{fdaCMA}}, \code{\LinkA{flexdaCMA}{flexdaCMA}}, \code{\LinkA{gbmCMA}{gbmCMA}},
\code{\LinkA{knnCMA}{knnCMA}}, \code{\LinkA{ldaCMA}{ldaCMA}}, \code{\LinkA{LassoCMA}{LassoCMA}},
\code{\LinkA{nnetCMA}{nnetCMA}}, \code{\LinkA{pknnCMA}{pknnCMA}}, \code{\LinkA{plrCMA}{plrCMA}},
\code{\LinkA{pls\_ldaCMA}{pls.Rul.ldaCMA}}, \code{\LinkA{pls\_lrCMA}{pls.Rul.lrCMA}}, \code{\LinkA{pls\_rfCMA}{pls.Rul.rfCMA}},
\code{\LinkA{pnnCMA}{pnnCMA}}, \code{\LinkA{qdaCMA}{qdaCMA}}, \code{\LinkA{rfCMA}{rfCMA}},
\code{\LinkA{scdaCMA}{scdaCMA}}, \code{\LinkA{shrinkldaCMA}{shrinkldaCMA}}, \code{\LinkA{svmCMA}{svmCMA}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
### simple linear discrimination for the golub data:
data(golub)
golubY <- golub[,1]
golubX <- as.matrix(golub[,-1])
golubn <- nrow(golubX)
set.seed(111)
learnind <- sample(golubn, size=floor(2/3*golubn))
Planarplot(X=golubX, y=golubY, learnind=learnind, predind=c(2,4),
           classifier=ldaCMA)

\end{ExampleCode}
\end{Examples}

