NSCpredictInterface {ClassifyR} | R Documentation |
pamr.predict
Function from pamr
CRAN PackageRestructures variables from ClassifyR framework to be compatible with pamr.predict
definition.
## S4 method for signature 'pamrtrained,matrix' NSCpredictInterface(trained, test, ...) ## S4 method for signature 'pamrtrained,DataFrame' NSCpredictInterface(trained, test, classes = NULL, ..., verbose = 3) ## S4 method for signature 'pamrtrained,MultiAssayExperiment' NSCpredictInterface(trained, test, targets = names(test), ...)
trained |
An object of class |
test |
An object of the same class as |
classes |
Either NULL or a character vector of length 1, specifying the column name to remove. |
targets |
If |
... |
Variables not used by the |
verbose |
Default: 3. A number between 0 and 3 for the amount of progress messages to give. This function only prints progress messages if the value is 3. |
This function is an interface between the ClassifyR framework and pamr.predict
.
It selects the highest threshold that gives the minimum error rate in the training data.
A factor of predicted classes for the test data.
Dario Strbenac
pamr.predict
for the function that was interfaced to.
if(require(pamr)) { # Samples in one class with differential expression to other class. genesMatrix <- sapply(1:25, function(geneColumn) c(rnorm(100, 9, 1))) genesMatrix <- cbind(genesMatrix, sapply(1:25, function(geneColumn) c(rnorm(75, 9, 1), rnorm(25, 14, 1)))) classes <- factor(rep(c("Poor", "Good"), each = 25)) fit <- NSCtrainInterface(genesMatrix[, c(1:20, 26:45)], classes[c(1:20, 26:45)]) NSCpredictInterface(fit, genesMatrix[, c(21:25, 46:50)]) }