lift: Gain and lift charts

Description Usage Arguments Value

View source: R/calibrate.R

Description

Validates predicted probabilities against a set of observed (binary) outcomes.

Usage

1
2
3
4
lift(prob, y, pos.class = NULL, cumulative = TRUE, nbins = 0)

## S3 method for class 'lift'
plot(x, refline.col = "red", refline.lty = "dashed", refline.lwd = 1, ...)

Arguments

prob

Vector of predicted probabilities.

y

Vector of binary (i.e., 0/1) outcomes. If y is coded as anything other than 0/1, then you must specify which of the two categories represents the "positive" class (i.e., the class for which the probabilities specified in prob correspond to) via the pos.class argument.

pos.class

Numeric/character string specifying which values in y correspond to the "positive" class. Default is NULL. (Must be specified whenever y is not coded as 0/1, where 1 is assumed to represent the "positive" class.)

cumulative

Logical indicating whether or not to compute cumulative lift (i.e., gain). Default is TRUE.

nbins

Integer specifying the number of bins to use when computing lift. Default is 0, which corresponds to no binning. For example, setting nbins = 10 will result in computing lift within each decile of the sorted probabilities.

x

An object of class "lift".

refline.col

The color to use for the reference line. Default is "red".

refline.lty

The type of line to use for the reference line. Default is "dashed".

refline.lwd

The width of the reference line. Default is 1.

...

Additional optional argument to be passed on to other methods.

Value

A "lift" object, which is essentially a list with the following components:

"lift"

A numeric vector containing the computed lift values.

"prop"

The corresponding proportion of cases associated with each lift value.

"cumulative"

Same value as that supplied via the cumulative argument. (Used by the plot.lift() method.)


bgreenwell/calibrater documentation built on Dec. 31, 2020, 8:53 p.m.