gainstable.rocit: Gains Table for Binary Classifier

View source: R/gainstable.R

gainstable.rocitR Documentation

Gains Table for Binary Classifier

Description

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

Usage

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

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.

Value

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

See Also

gainstable.default, plot.gainstable, rocit

Examples

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)


ROCit documentation built on May 29, 2024, 2:15 a.m.