\HeaderA{fs.absT}{support for feature selection in cross-validation}{fs.absT}
\aliasA{fs.probT}{fs.absT}{fs.probT}
\aliasA{fs.topVariance}{fs.absT}{fs.topVariance}
\keyword{models}{fs.absT}
\begin{Description}\relax
support for feature selection in cross-validation
\end{Description}
\begin{Usage}
\begin{verbatim}
fs.absT(N)
fs.probT(p)
fs.topVariance(p)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{N}] number of features to retain; features are ordered
by descending value of abs(two-sample t stat.), and the top N are
used. 
\item[\code{p}] cumulative probability (in (0,1)) in the distribution of absolute t statistics
above which we retain features
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function returns a function that will be used as a parameter
to \code{\LinkA{xvalSpec}{xvalSpec}} in applications of \code{\LinkA{MLearn}{MLearn}}.
\end{Details}
\begin{Value}
a function is returned, that will itself return a formula
consisting of the selected features for application of \code{\LinkA{MLearn}{MLearn}}.
\end{Value}
\begin{Note}\relax
The functions \code{fs.absT} and \code{fs.probT} are
two examples of approaches to embedded feature selection that make
sense for two-sample prediction problems.  For selection based on
linear models or other discrimination measures, you will need to create
your own selection helper, following the code in these functions as
examples.

fs.topVariance performs non-specific feature selection based on the 
variance.  Argument p is the variance percentile beneath which features are
discarded.
\end{Note}
\begin{Author}\relax
VJ Carey \textless{}stvjc@channing.harvard.edu\textgreater{}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{MLearn}{MLearn}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
# we will demonstrate this procedure with the crabs data.
# first, create the closure to pick 3 features
demFS = fs.absT(3)
# run it on the entire dataset with features excluding sex
demFS(sp~.-sex, crabs)
# emulate cross-validation by excluding last 50 records
demFS(sp~.-sex, crabs[1:150,])
# emulate cross-validation by excluding first 50 records -- different features retained
demFS(sp~.-sex, crabs[51:200,])
\end{ExampleCode}
\end{Examples}

