# NOT RUN {
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 {
library(kernlab)
data(spam)
test <- sample(1:4601,2000)
dt <- as.matrix(spam[-test ,-58])
labels <- spam[-test , 58]
margRelv <- marginalRelevance(dt, labels)
#plot MR scores
plot(margRelv)
plot(margRelv , col = labels, type = "pairs", n.feat = 5)
plot(margRelv , col = labels, type = "parallelcoord", n.feat = 30)
# test set
plot(margRelv , as.matrix(spam[test ,-58]), col = spam[test , 58],
type = "pairs", n.feat = 5)
plot(margRelv , as.matrix(spam[test ,-58]), col = spam[test , 58],
type = "parallelcoord", n.feat = 30)
# }
Run the code above in your browser using DataLab