\HeaderA{confuMat-methods}{Compute the confusion matrix for a classifier.}{confuMat.Rdash.methods}
\aliasA{confuMat}{confuMat-methods}{confuMat}
\aliasA{confuMat,classifierOutput,character-method}{confuMat-methods}{confuMat,classifierOutput,character.Rdash.method}
\aliasA{confuMat,classifierOutput,missing-method}{confuMat-methods}{confuMat,classifierOutput,missing.Rdash.method}
\aliasA{confuMat,classifierOutput-method}{confuMat-methods}{confuMat,classifierOutput.Rdash.method}
\keyword{methods}{confuMat-methods}
\keyword{classif}{confuMat-methods}
\begin{Description}\relax
This function will compute the confusion matrix for a classifier's output
\end{Description}
\begin{Section}{Methods}
\describe{
\item[obj = "classifOutput"] Typically, an instance of class 
\code{"\LinkA{classifierOutput}{classifierOutput.Rdash.class}"}
is built on a training subset of the input data. The model is then
used to predict the class of samples in the test set.  When the
true class labels for the test set are available the confusion matrix
is the cross-tabulation of the true labels
of the test set against the predictions from the classifier.
 
\item[obj = "classifierOutput", type="character"] For instances of \LinkA{classifierOutput}{classifierOutput.Rdash.class}, it is possible
to specify the \code{type} of confusion matrix desired.
The default is \code{test}, which tabulates classes from the
test set against the associated predictions.  If \code{type} is
\code{train}, the training class vector is tabulated against the
predictions on the training set.
 
}
\end{Section}
\begin{Examples}
\begin{ExampleCode}
library(golubEsets)
data(Golub_Merge)
smallG <- Golub_Merge[101:150,]
k1 <- MLearn(ALL.AML~., smallG, knnI(k=1), 1:30)
confuMat(k1)
confuMat(k1, "train")
\end{ExampleCode}
\end{Examples}

