if(require(sparsediscrim))
{
# Samples in one class with differential variability to other class.
# First 20 genes are DV.
genesMatrix <- sapply(1:25, function(sample) c(rnorm(100, 9, 1)))
genesMatrix <- cbind(genesMatrix, rbind(sapply(1:25, function(sample) rnorm(20, 9, 5)),
sapply(1:25, function(sample) rnorm(80, 9, 1))))
classes <- factor(rep(c("Poor", "Good"), each = 25))
genesMatrix <- exprs(subtractFromLocation(genesMatrix, 1:ncol(genesMatrix)))
leveneSelection(genesMatrix, classes, "Example",
trainParams = TrainParams(fisherDiscriminant, FALSE, 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