File: predict.gafs.Rd

package info (click to toggle)
r-cran-caret 6.0-81-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,268 kB
  • sloc: ansic: 208; sh: 10; makefile: 2
file content (57 lines) | stat: -rw-r--r-- 1,246 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gafs.R
\name{predict.gafs}
\alias{predict.gafs}
\alias{predict.safs}
\title{Predict new samples}
\usage{
\method{predict}{gafs}(object, newdata, ...)
}
\arguments{
\item{object}{an object of class \code{\link{safs}} or \code{\link{gafs}}}

\item{newdata}{a data frame or matrix of predictors.}

\item{\dots}{not currently used}
}
\value{
The type of result depends on what was specified in
\code{object$control$functions$predict}.
}
\description{
Predict new samples using \code{\link{safs}} and \code{\link{gafs}} objects.
}
\details{
Only the predictors listed in \code{object$optVariables} are required.
}
\examples{

\dontrun{

set.seed(1)
train_data <- twoClassSim(100, noiseVars = 10)
test_data  <- twoClassSim(10,  noiseVars = 10)

## A short example
ctrl <- safsControl(functions = rfSA,
                    method = "cv",
                    number = 3)

rf_search <- safs(x = train_data[, -ncol(train_data)],
                  y = train_data$Class,
                  iters = 3,
                  safsControl = ctrl)

rf_search

predict(rf_search, train_data)
}

}
\seealso{
\code{\link{safs}}, \code{\link{gafs}}
}
\author{
Max Kuhn
}
\keyword{multivariate}