Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

panel.lift2

Lattice Panel Functions for Lift Plots


Description

Two panel functions that be used in conjunction with lift.

Usage

panel.lift2(x, y, pct = 0, values = NULL, ...)

Arguments

x

the percentage of searched to be plotted in the scatterplot

y

the percentage of events found to be plotted in the scatterplot

pct

the baseline percentage of true events in the data

values

A vector of numbers between 0 and 100 specifying reference values for the percentage of samples found (i.e. the y-axis). Corresponding points on the x-axis are found via interpolation and line segments are shown to indicate how many samples must be tested before these percentages are found. The lines use either the plot.line or superpose.line component of the current lattice theme to draw the lines (depending on whether groups were used

...

options to pass to panel.xyplot

Details

panel.lift plots the data with a simple (black) 45 degree reference line.

panel.lift2 is the default for lift and plots the data points with a shaded region encompassing the space between to the random model and perfect model trajectories. The color of the region is determined by the lattice reference.line information (see example below).

Author(s)

Max Kuhn

See Also

Examples

set.seed(1)
simulated <- data.frame(obs = factor(rep(letters[1:2], each = 100)),
                        perfect = sort(runif(200), decreasing = TRUE),
                        random = runif(200))

regionInfo <- trellis.par.get("reference.line")
regionInfo$col <- "lightblue"
trellis.par.set("reference.line", regionInfo)

lift2 <- lift(obs ~ random + perfect, data = simulated)
lift2
xyplot(lift2, auto.key = list(columns = 2))

## use a different panel function
xyplot(lift2, panel = panel.lift)

caret

Classification and Regression Training

v6.0-86
GPL (>= 2)
Authors
Max Kuhn [aut, cre], Jed Wing [ctb], Steve Weston [ctb], Andre Williams [ctb], Chris Keefer [ctb], Allan Engelhardt [ctb], Tony Cooper [ctb], Zachary Mayer [ctb], Brenton Kenkel [ctb], R Core Team [ctb], Michael Benesty [ctb], Reynald Lescarbeau [ctb], Andrew Ziem [ctb], Luca Scrucca [ctb], Yuan Tang [ctb], Can Candan [ctb], Tyler Hunt [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.