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

predict.wilma(object, newdata = NULL, type = c("fitted", "class"),
              classifier = c("nnr", "dlda", "logreg", "aggtrees"),
              noc = object$noc, ...)

Arguments

object An R object of class "wilma", typically the result of wilma().
newdata Numeric matrix with the same number of explanatory variables as the original x-matrix (p variables in columns, r cases in rows). For example, these can be additional microarray gene expression data which should be predicted.
type Character string, describing whether fitted values "fitted" or predicted class labels "class" should be returned.
classifier Character string, saying which classifier should be used. Choices are "nnr", the 1-nearest-neighbor-rule; "dlda", diagonal linear discriminant analysis; "logreg", logistic regression; "aggtrees" aggregated trees.
noc Integer, saying with 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.
...

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

References

Marcel Dettling (2002) Supervised Clustering of Genes, see http://stat.ethz.ch/~dettling/supercluster.html

Marcel Dettling and Peter Bühlmann (2002). Supervised Clustering of Genes. Genome Biology, 3(12): research0069.1-0069.15.

See Also

wilma 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")

[Package supclust version 1.0-5 Index]