| scr_classing_spec | R Documentation |
One row per bin of every variable in the lab, optimal and manual, with
the authoritative columns a reviewer may edit (lower/upper for
numerics, categories/is_other for categoricals, reason) and
context columns that are regenerated on read. Open ends are written as
NA. scr_classing_read() validates a file back into a spec and
scr_classing_import() turns every variable whose bins differ from the
lab's current ones into a proposal, so a spreadsheet edit never enters
silently.
scr_classing_spec(lab, file = NULL)
scr_classing_read(file, sep = "%;%")
scr_classing_import(lab, file)
lab |
An object from |
file |
For |
sep |
Bin separator of the |
A data.frame of class scr_classing_spec.
scr_classing_import() returns a named list of proposals (one
per variable whose bins differ from the lab's current ones), each to be
accepted or discarded.
scr_coarse_classing() for a complete session, from lab to
scorecard.
Other classing:
scr_classing_accept(),
scr_classing_apply(),
scr_classing_choose(),
scr_classing_propose(),
scr_classing_view(),
scr_coarse_classing(),
scr_decisions()
cfg <- scr_config(verbose = FALSE, nthread = 1, use_ranger = FALSE,
use_lightgbm = FALSE, xgb_rounds = 40, n_boot = 10)
d <- scr_demo[, c("default", "ref_date", "ds_region", "ds_band", "vl_score_01",
"vl_score_02", "vl_score_05", "vl_score_10", "vl_hist_01")]
res <- scr_select(d, "default", config = cfg, date_col = "ref_date")
lab <- scr_coarse_classing(res)
p <- scr_classing_propose(lab, "ds_region",
groups = list(edge = c("NORTH", "SOUTH"),
core = c("EAST", "WEST", "CENTRE")))
lab <- scr_classing_accept(lab, p, reason = "edge/core is what pricing uses")
sp <- scr_classing_spec(lab)
sp
# round trip through a file: a fresh lab receives the manual bins as proposals
f <- tempfile(fileext = ".csv")
scr_classing_spec(lab, file = f)
props <- scr_classing_import(scr_coarse_classing(res), scr_classing_read(f))
names(props)
unlink(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.