
Last chance! 50% off unlimited learning
Sale ends in
"KullbackLeiblerSelection"(expression, classes, ...) "KullbackLeiblerSelection"(expression, datasetName, trainParams, predictParams, resubstituteParams, ..., selectionName, verbose = 3)
matrix
or ExpressionSet
containing
the training data. For a matrix, the rows are features, and the columns
are samples.TrainParams
describing the
classifier to use for training.PredictParams
describing how
prediction is to be done.ResubstituteParams
describing the performance measure to consider and the numbers of
top features to try for resubstitution classification.getLocationsAndScales
.SelectResult
or a list of such objects, if the classifier which was used
for determining resubstitution error rate made a number of prediction varieties.
if(require(sparsediscrim))
{
# First 20 features have bimodal distribution for Poor class. Other 80 features have normal distribution for
# both classes.
genesMatrix <- sapply(1:25, function(sample) c(rnorm(20, sample(c(8, 12), 20, replace = TRUE), 1), rnorm(80, 10, 1)))
genesMatrix <- cbind(genesMatrix, sapply(1:25, function(sample) rnorm(100, 10, 1)))
classes <- factor(rep(c("Poor", "Good"), each = 25))
KullbackLeiblerSelection(genesMatrix, classes, "Example",
trainParams = TrainParams(naiveBayesKernel, FALSE, doesTests = TRUE),
predictParams = PredictParams(function(){}, FALSE, getClasses = function(result) result),
resubstituteParams = ResubstituteParams(nFeatures = seq(10, 100, 10), performanceType = "balanced", better = "lower")
)
}
Run the code above in your browser using DataLab