marginalRelevance {BKPC} | R Documentation |
Calculates Marginal Relevance of each feature (variable) useful for class (group) separation. The marginal relevance score is a ratio of the between-group to within-group sum of squares.
marginalRelevance(x, y)
x |
a data matrix. |
y |
a response vector. Should be a factor. |
An object of class "marginalRelevance"
including:
score |
Marginal relevance score of each feature. |
rank |
The ranking in order of highest marginal relevance for each feature. |
orderedData |
Data matrix with columns reordered by the marginal relevance of the features. |
bestVars |
Features ordered by the marginal relevance. |
K. Domijan
Dudoit S., J. Fridlyand, T. P. Speed: Comparison of discrimination methods for the classification of tumors using gene expression data. Journal of the American Statistical Association, 2002, Volume 97 No 457, pp 77-87.
plot.marginalRelevance
microarray
data(microarray) profiles <- as.matrix(microarray[, -2309]) tumourType <- microarray[, 2309] margRelv <- marginalRelevance(profiles, tumourType) # plot 30 gene profiles with highest marginal relevance score plot(margRelv, type = "parallelcoord", n.feat = 50, col = tumourType ) ## Not run: # another example: wine data from gclus library(gclus) data(wine) dt <- as.matrix(wine[, -1]) colnames(dt) <- names(wine[, -1]) label <- as.factor(wine[, 1]) margRelv <- marginalRelevance(dt, label) #variables in order of their MR score colnames(dt)[ margRelv$bestVars] cparcoord(dt, order = margRelv$bestVars, col = label) cpairs(dt, order = margRelv$bestVars, col = label) ## End(Not run)