\name{stam.predict}
\alias{stam.predict}
\title{Predict Classifications of New Data}
\description{
  StAM analysis on new data using a given model fit.
}
\usage{
stam.predict(fit, expression.matrix, classifications = NULL, 
             testset = NULL)
}
\arguments{
  \item{fit}{stamFit object containing a trained model}
  \item{expression.matrix}{matrix or \code{exprSet} or
    \code{ExpressionSet}, containing new data}
  \item{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{testset}{indeces of samples not yued in training}
}
\details{
  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.
}
\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.
}
\author{Claudio Lottaz}
\seealso{\code{\link{stamPrediction-class}}, \code{\link{plot.stamPrediction}}, 
  \code{\link{image.stamPrediction}}, \code{\link{stam.fit}}, 
  \code{\link{stam.writeHTML}}}
\examples{
# 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)
\dontrun{
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=""))
}}
\keyword{classif}
