lift.formula
is used to process the data and xyplot.lift
is used to create the plot.To construct data for the the lift and gain plots, the following steps are used for each model:
- The data are ordered by the numeric model prediction used on the right-hand side of the model formula
- Each unque value of the score is treated as a cut point
- The number of samples with true results equal to
class
are determined - The lift is calculated as the ratio of the percentage of samples in each split corresponding to
class
over the same percentage in the entire data set
lift
with plot = "gain"
produces a plot of the cumulative lift values by the percentage of samples evaluated while plot = "lift"
shows the cut point value versus the lift statistic. This implementation uses the lattice function xyplot
, so plot elements can be changed via panel functions, trellis.par.set
or other means. lift
uses the panel function panel.lift2
by default, but it can be changes using update.trellis
(see the examples in panel.lift2
).
The following elements are set by default in the plot but can be changed by passing new values into xyplot.lift
: xlab = "% Samples Tested"
, ylab = "% Samples Found"
, type = "S"
, ylim = extendrange(c(0, 100))
and xlim = extendrange(c(0, 100))
.