\Header{pamr.adaptthresh}{A function  to adaptive choose threshold scales, for
use in pamr.train}
\begin{Description}\relax
A function  to adaptive choose threshold scales, for
use in pamr.train\end{Description}
\begin{Usage}
\begin{verbatim}
pamr.adaptthresh(object, ntries = 10, reduction.factor = 0.9, full.out = F)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] The result of a call to pamr.train 
\item[\code{ntries}] Number of iterations to use in algorithm
\item[\code{reduction.factor}] Amount by which a scaling is reduced in one
step of the algorithm
\item[\code{full.out}] Provide more detailed  output
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{pamr.adaptthresh} Adaptively searches for  set of
good threshold scales.  The baseline (default) scale is 1 for
each class. The idea is that for easy to classify classes,
the threshold scale can be increased without increasing the error
rate for that class, and resulting in fewer genes needed for the
classification rule. The scalings from pamr.adaptthresh are then used
in pamr.train, and pamr.cv. The results may be better than those obtained
with the default values of threshold.scale.\end{Details}
\begin{Author}\relax
Trevor Hastie, Robert Tibshirani, Balasubramanian Narasimhan, and Gilbert Chu\end{Author}
\begin{References}\relax
Robert Tibshirani, Trevor Hastie, Balasubramanian Narasimhan, and Gilbert Chu. "Diagnosis of multiple cancer types by shrunken centroids of gene expression"  PNAS 2002 99:6567-6572 (May 14). 

Robert Tibshirani,  Trevor Hastie, Balasubramanian Narasimhan, and Gilbert Chu (2002).
Class prediction by  
nearest shrunken centroids,with applications
to DNA microarrays. Stanford tech report.\end{References}
\begin{Examples}
\begin{ExampleCode}
set.seed(120)
x <- matrix(rnorm(1000*20),ncol=20)
y <- sample(c(1:4),size=20,replace=TRUE)
mydata <- list(x=x,y=y)
mytrain <-   pamr.train(mydata)
new.scales <- pamr.adaptthresh(mytrain)

 
mytrain2 <- pamr.train(mydata, threshold.scale=new.scales)

myresults2 <- pamr.cv(mytrain2, mydata)

\end{ExampleCode}
\end{Examples}

