Learn R Programming

ROCR (version 1.0-1)

plot-methods: Plot method for performance objects

Description

This is the method to plot all objects of class performance.

Usage

## S3 method for class 'performance,missing':
plot(x, y, ..., avg="none", spread.estimate="none",
  spread.scale=1, show.spread.at=c(), colorize=F,
  colorize.palette=rev(rainbow(256,start=0, end=4/6)),
  colorkey=colorize, colorkey.relwidth=0.25, colorkey.pos="right",
  print.cutoffs.at=c(), cutoff.label.function=function(x) { round(x,2) },
  downsampling=0, add=FALSE )

Arguments

x
an object of class performance
y
not used
...
Optional graphical parameters to adjust different components of the performance plot. Parameters are directed to their target component by prefixing them with the name of the component (component.parameter, e.g. text.cex
avg
If the performance object describes several curves (from cross-validation runs or bootstrap evaluations of one particular method), the curves from each of the runs can be averaged. Allowed values are none (plot all curves separate
spread.estimate
When curve averaging is enabled, the variation around the average curve can be visualized as standard error bars (stderror), standard deviation bars (stddev), or by using box plots (boxplot). Note that th
spread.scale
For stderror or stddev, this is a scalar factor to be multiplied with the length of the standard error/deviation bar. For example, under normal assumptions, spread.scale=2 can be used to get approximate 9
show.spread.at
For vertical averaging, this vector determines the x positions for which the spread estimates should be visualized. In contrast, for horizontal and threshold averaging, the y positions and cutoffs are determined, respectively. By default,
colorize
This logical determines whether the curve(s) should be colorized according to cutoff.
colorize.palette
If curve colorizing is enabled, this determines the color palette onto which the cutoff range is mapped.
colorkey
If true, a color key is drawn into the 4% border region (default of par(xaxs) and par(yaxs)) of the plot. The color key visualizes the mapping from cutoffs to colors.
colorkey.relwidth
Scalar between 0 and 1 that determines the fraction of the 4% border region that is occupied by the colorkey.
colorkey.pos
Determines if the colorkey is drawn vertically at the right side, or horizontally at the top of the plot.
print.cutoffs.at
This vector specifies the cutoffs which should be printed as text along the curve at the corresponding curve positions.
cutoff.label.function
By default, cutoff annotations along the curve or at the color key are rounded to two decimal places before printing. Using a custom cutoff.label.function, any other transformation can be performed on the cutoffs instead (e.g. ro
downsampling
ROCR can efficiently compute most performance measures even for data sets with millions of elements. However, plotting of large data sets can be slow and lead to PS/PDF documents of considerable size. In that case, performance curves that are
add
If TRUE, the curve(s) is/are added to an already existing plot; otherwise a new plot is drawn.

References

A detailed list of references can be found on the ROCn'COST homepage at http://rocr.bioinf.mpi-sb.mpg.de.

See Also

prediction, performance, prediction-class, performance-class

Examples

Run this code
# plotting a ROC curve:
library(ROCR)
data(ROCR.simple)
pred <- prediction( ROCR.simple$predictions, ROCR.simple$labels )
perf <- performance( pred, "tpr", "fpr" )
plot( perf )

# To entertain your children, make your plots nicer
# using ROCR's flexible parameter passing mechanisms
# (much cheaper than a finger painting set)
par(bg="lightblue", mai=c(1.2,1.5,1,1))
plot(perf, main="ROCR fingerpainting toolkit", colorize=TRUE,
  xlab="Mary's axis", ylab="", box.lty=7, box.lwd=5,
  box.col="gold", lwd=17, colorkey.relwidth=0.5, xaxis.cex.axis=2,
  xaxis.col='blue', xaxis.col.axis="blue", yaxis.col='green', yaxis.cex.axis=2,
  yaxis.at=c(0,0.5,0.8,0.85,0.9,1), yaxis.las=1, xaxis.lwd=2, yaxis.lwd=3,
  yaxis.col.axis="orange", cex.lab=2, cex.main=2)

Run the code above in your browser using DataLab