scr_gains: Gains table, at bin level

View source: R/accessors.R

scr_gainsR Documentation

Gains table, at bin level

Description

One row per variable and bin, with counts, event rate, WOE, IV, lift, cumulative KS, precision and recall, plus the hold-out IV and the PSI of the variable.

Usage

scr_gains(x, only_selected = TRUE)

Arguments

x

An object from scr_select().

only_selected

If TRUE (default), only the approved variables.

Value

A data.table at bin level.

See Also

Other accessors: scr_funnel(), scr_leakage(), scr_result, scr_score_gains(), scr_score_metrics(), scr_selected()

Examples

cfg <- scr_config(verbose = FALSE, nthread = 1, use_ranger = FALSE,
                  xgb_rounds = 60, n_boot = 20)
res <- scr_select(scr_demo, "default", config = cfg, drop = "id",
                  date_col = "ref_date")
g <- scr_gains(res)
g[feature == scr_selected(res)[1], .(bin, count, pos_rate, woe, iv)]

scorecraft documentation built on Dec. 6, 2026, 1:09 a.m.