predict.wilma {supclust} | R Documentation |
Predict Method for Wilma
Description
Yields fitted values or predicted class labels for training
and test data, which are based on the supervised gene clusters
wilma
found, and on a choice of four different classifiers: the
nearest-neighbor rule, diagonal linear discriminant analysis, logistic
regression and aggregated trees.
Usage
## S3 method for class 'wilma'
predict(object, newdata = NULL, type = c("fitted", "class"),
classifier = c("nnr", "dlda", "logreg", "aggtrees"),
noc = object$noc, ...)
Arguments
object |
an R object of |
newdata |
numeric matrix with the same number of explanatory
variables as the original |
type |
character string describing whether fitted values
|
classifier |
character string specifying which classifier should
be used. Choices are |
noc |
integer specifying how many clusters the fitted values or class label predictions should be determined. Also numeric vectors are allowed as an argument. The output is then a numeric matrix with fitted values or class label predictions for a multiple number of clusters. |
... |
further arguments passed to and from methods. |
Details
If newdata = NULL
, then the in-sample fitted values or class
label predictions are returned.
Value
Depending on whether noc
is a single number or a numeric
vector. In the first case, a numeric vector of length r
is
returned, which contains fitted values for noc
clusters, or
class label predictions with noc
clusters.
In the latter case, a numeric matrix with length(noc)
columns,
each containing fitted values for noc
clusters, or class label
predictions with noc
clusters, is returned.
Author(s)
Marcel Dettling, dettling@stat.math.ethz.ch
See Also
wilma
also for references, and for the four
classifiers
nnr
, dlda
, logreg
,
aggtrees
.
Examples
## Working with a "real" microarray dataset
data(leukemia, package="supclust")
## Generating random test data: 3 observations and 250 variables (genes)
set.seed(724)
xN <- matrix(rnorm(750), nrow = 3, ncol = 250)
## Fitting Wilma
fit <- wilma(leukemia.x, leukemia.y, noc = 3, trace = 1)
## Fitted values and class predictions for the training data
predict(fit, type = "cla")
predict(fit, type = "fitt")
## Predicting fitted values and class labels for test data
predict(fit, newdata = xN)
predict(fit, newdata = xN, type = "cla", classifier = "nnr", noc = c(1,2,3))
predict(fit, newdata = xN, type = "cla", classifier = "dlda", noc = c(1,3))
predict(fit, newdata = xN, type = "cla", classifier = "logreg")
predict(fit, newdata = xN, type = "cla", classifier = "aggtrees")