Description Usage Arguments Details Value Author(s) Examples
For a data set of features and samples, the classification process is run. It consists of data transformation, feature selection, classifier training and testing.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## S4 method for signature 'matrix'
runTest(measurements, classes, ...)
## S4 method for signature 'DataFrame'
runTest(measurements, classes, featureSets = NULL, metaFeatures = NULL,
minimumOverlapPercent = 80, datasetName, classificationName,
training, testing, params = list(SelectParams(), TrainParams(), PredictParams()),
verbose = 1, .iteration = NULL)
## S4 method for signature 'MultiAssayExperiment'
runTest(measurements, targets = names(measurements), ...)
## S4 method for signature 'MultiAssayExperiment'
runTestEasyHard(measurements, easyDatasetID = "clinical", hardDatasetID = names(measurements)[1],
featureSets = NULL, metaFeatures = NULL, minimumOverlapPercent = 80,
datasetName = NULL, classificationName = "Easy-Hard Classifier", training, testing, ..., verbose = 1, .iteration = NULL)
|
measurements |
Either a |
classes |
Either a vector of class labels of class |
featureSets |
An object of type |
metaFeatures |
Either |
minimumOverlapPercent |
If |
targets |
If |
... |
For |
datasetName |
A name associated with the data set used. |
classificationName |
A name associated with the classification. |
training |
A vector which specifies the training samples. |
testing |
A vector which specifies the test samples. |
params |
A |
easyDatasetID |
The name of a data set in |
hardDatasetID |
The name of a data set in |
verbose |
Default: 1. A number between 0 and 3 for the amount of progress messages to give. A higher number will produce more messages as more lower-level functions print messages. |
.iteration |
Not to be set by a user. This value is used to keep track of the cross-validation
iteration, if called by |
This function only performs one classification and prediction. See runTests
for a driver function that enables a number of different cross-validation schemes to be applied
and uses this function to perform each iteration. datasetName
and classificationName
need to be provided.
If called directly by the user rather than being used internally by runTests
, a
SelectResult
object.
Dario Strbenac
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 | #if(require(sparsediscrim))
#{
data(asthma)
resubstituteParams <- ResubstituteParams(nFeatures = seq(5, 25, 5),
performanceType = "balanced error",
better = "lower")
runTest(measurements, classes,
datasetName = "Asthma", classificationName = "Different Means",
params = list(SelectParams(limmaSelection, "Moderated t Statistic",
resubstituteParams = resubstituteParams),
TrainParams(DLDAtrainInterface),
PredictParams(DLDApredictInterface)
),
training = (1:ncol(measurements)) %% 2 == 0,
testing = (1:ncol(measurements)) %% 2 != 0)
#}
genesMatrix <- matrix(c(rnorm(90, 9, 1),
9.5, 9.4, 5.2, 5.3, 5.4, 9.4, 9.6, 9.9, 9.1, 9.8),
ncol = 10, byrow = TRUE)
colnames(genesMatrix) <- paste("Sample", 1:10)
rownames(genesMatrix) <- paste("Gene", 1:10)
genders <- factor(c("Male", "Male", "Female", "Female", "Female",
"Female", "Female", "Female", "Female", "Female"))
# Scenario: Male gender can predict the hard-to-classify Sample 1 and Sample 2.
clinical <- DataFrame(age = c(31, 34, 32, 39, 33, 38, 34, 37, 35, 36),
gender = genders,
class = factor(rep(c("Poor", "Good"), each = 5)),
row.names = colnames(genesMatrix))
dataset <- MultiAssayExperiment(ExperimentList(RNA = genesMatrix), clinical)
selParams <- SelectParams(featureSelection = differentMeansSelection, selectionName = "Difference in Means",
resubstituteParams = ResubstituteParams(1:10, "balanced error", "lower"))
easyHardCV <- runTestEasyHard(dataset, datasetName = "Test Data", classificationName = "Easy-Hard", training = 1:10, testing = 1:10,
easyClassifierParams = list(minCardinality = 2, minPurity = 0.9),
hardClassifierParams = list(selParams, TrainParams(), PredictParams())
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.