\HeaderA{stam.predict}{Predict Classifications of New Data}{stam.predict}
\keyword{classif}{stam.predict}
\begin{Description}\relax
StAM analysis on new data using a given model fit.
\end{Description}
\begin{Usage}
\begin{verbatim}
stam.predict(fit, expression.matrix, classifications = NULL, 
             testset = NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{fit}] stamFit object containing a trained model
\item[\code{expression.matrix}] matrix or \code{exprSet} or
\code{ExpressionSet}, containing new data
\item[\code{classifications}] character vector specifying class names per sample. You may 
either specify one class per sample in the expression.matrix, or one
class per training sample (all but the testset).
\item[\code{testset}] indeces of samples not yued in training
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
stam.predict uses an object returned by stam.fit to perform a structured analysis of 
the new expression data provided. Thereby, it uses all classifiers in the leaf nodes
to provide classification results in these for each sample. In addition, weighted sums
in inner nodes are computed to provide classification results for the whole graph.
\end{Details}
\begin{Value}
An object of type stamPrediction is returned. You may use print, plot and image 
functions to further investigate the results. Information on node classifiers are
obtained through the print methods on elements of the \code{nodes} slot.
\end{Value}
\begin{Author}\relax
Claudio Lottaz
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{stamPrediction-class}{stamPrediction.Rdash.class}}, \code{\LinkA{plot.stamPrediction}{plot.stamPrediction}}, 
\code{\LinkA{image.stamPrediction}{image.stamPrediction}}, \code{\LinkA{stam.fit}{stam.fit}}, 
\code{\LinkA{stam.writeHTML}{stam.writeHTML}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Not run: 
# load and prepare data
library(golubEsets)
data(Golub_Merge)
golubTest <- Golub_Merge[,39:72]
data(golubTrain.fit)

# compute predictions
golubTest.pred <- stam.predict(golubTrain.fit, golubTest, 
                               pData(golubTest)[,"ALL.AML"])
golubMerge.pred <- stam.predict(golubTrain.fit, Golub_Merge, 
                                pData(Golub_Merge)[,"ALL.AML"], testset=39:72)

# further investigate
print(golubTest.pred)
plot(golubTest.pred)
## End(Not run)
## Not run: 
map <- image(golubMerge.pred, outfile="golubMerge")
cat("<HTML><BODY><MAP NAME='image_map'>", map, "</MAP>",
    "<IMG SRC='golubMerge_pred_img.png' USEMAP='#image_map'></BODY></HTML>\n", 
    file="pred_img.html")
browseURL(paste("file://", getwd(), "/pred_img.html", sep=""))
## End(Not run)\end{ExampleCode}
\end{Examples}

