previousSelection {ClassifyR} | R Documentation |
Uses the feature selection of the same cross-validation iteration of a previous classification for the current classification task.
## S4 method for signature 'matrix' previousSelection(measurements, ...) ## S4 method for signature 'DataFrame' previousSelection(measurements, classes, datasetName, classifyResult, minimumOverlapPercent = 80, selectionName = "Previous Selection", .iteration, verbose = 3) ## S4 method for signature 'MultiAssayExperiment' previousSelection(measurements, ...)
measurements |
Either a |
classes |
Do not specify this variable. It is ignored and only used to create consistency of formal parameters with other feature selection methods. |
... |
Variables not used by the |
datasetName |
A name for the data set used. Stored in the result. |
classifyResult |
An existing classification result from which to take the feature selections from. |
minimumOverlapPercent |
If at least this many selected features can't be identified in the current data set, then the selection stops with an error. |
selectionName |
A name to identify this selection method by. Stored in the result. |
.iteration |
Do not specify this variable. It is set by |
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. |
An object of class SelectResult
.
Dario Strbenac
#if(require(sparsediscrim)) #{ # Genes 76 to 100 have differential expression. genesMatrix <- sapply(1:25, function(sample) c(rnorm(100, 9, 2))) genesMatrix <- cbind(genesMatrix, sapply(1:25, function(sample) c(rnorm(75, 9, 2), rnorm(25, 14, 2)))) colnames(genesMatrix) <- paste("Sample", 1:50) rownames(genesMatrix) <- paste("Gene", 1:100) classes <- factor(rep(c("Poor", "Good"), each = 25)) resubstitute <- ResubstituteParams(nFeatures = seq(10, 100, 10), performanceType = "error", better = "lower") result <- runTests(genesMatrix, classes, "Example", "Differential Expression", permutations = 2, fold = 2, params = list(SelectParams(), TrainParams(), PredictParams())) # Genes 50 to 74 have differential expression in new data set. newDataset <- sapply(1:25, function(sample) c(rnorm(100, 9, 2))) newDataset <- cbind(newDataset, rbind(sapply(1:25, function(sample) rnorm(49, 9, 2)), sapply(1:25, function(sample) rnorm(25, 14, 2)), sapply(1:25, function(sample) rnorm(26, 9, 2)))) rownames(newDataset) <- rownames(genesMatrix) colnames(newDataset) <- colnames(genesMatrix) newerResult <- runTests(newDataset, classes, "Latest Data Set", "Differential Expression", permutations = 2, fold = 2, params = list(SelectParams(previousSelection, intermediate = ".iteration", classifyResult = result), TrainParams(), PredictParams())) # However, only genes 76 to 100 are chosen, because the feature selections are # carried over from the first cross-validated classification. features(newerResult) #}