Learn R Programming

ROCit (version 2.1.1)

gainstable.rocit: Gains Table for Binary Classifier

Description

S3 method to create gains table from object of class "rocit".

Usage

# S3 method for rocit
gainstable(x, ngroup = 10, breaks = NULL, ... = NULL)

Value

A list of class "gainstable", same as returned by gainstable.default.

Arguments

x

A "rocit" object, created with rocit.

ngroup

Number of desired groups in gains table. See gainstable.default.

breaks

Percentiles (in percentage) at which observations should be separated to form groups. See gainstable.default

...

NULL. Used for S3 generic/method consistency.

Details

gainstable.rocit calls gainstable.default. It creates the score and class variables from the supplied "rocit" object internally. See gainstable.default for details.

See Also

gainstable.default, plot.gainstable, rocit

Examples

Run this code
data("Loan")
class <- Loan$Status
score <- Loan$Score
rocit_emp <- rocit(score = score, class = class, negref = "FP")
# ----------------------------------------------------------------
gtable15 <- gainstable(rocit_emp, ngroup = 15)
gtable_custom <- gainstable(rocit_emp, breaks = seq(1,100,15))
print(gtable15)
print(gtable_custom)
# ----------------------------------------------------------------
plot(gtable15)
plot(gtable_custom)
plot(gtable_custom, type = 2)
plot(gtable_custom, type = 3)

Run the code above in your browser using DataLab