Learn R Programming

BKPC (version 1.0.1)

plot.marginalRelevance: Plot marginalRelevance Objects

Description

Plots marginal relevance scores for features of a given data matrix. The default plot shows: the marginal relevance score (MR score) of each feature. The "pairs" and "parallelcoord" show scatterplot matrix and the parallel coordinates plot of features ordered by their MR score.

Usage

# S3 method for marginalRelevance
plot(x, newdata = NULL, n.feat = NULL, type = "default", ...)

Arguments

x

a marginalRelevance object.

newdata

a matrix containing the new input data.

n.feat

the number of features with highest MR score to plot. Default is all features.

type

"parallelcoord", "pairs" or default.

options directly passed to the plot function.

Details

If newdata is omitted the predictions are based on the data used for deriving the MR score.

See Also

marginalRelevance

Examples

Run this code
# 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