| scr_select | R Documentation |
Shortcut that chains scr_split(), scr_triage(), scr_bin() and
scr_model() on a table and a binary target, and returns an object with
the shortlist, the complete audit funnel, the gains table and the
production SQL of the approved variables. Every stage remains callable on
its own for whoever wants more control (hybrid interface).
scr_select(
data,
target,
config = scr_config(),
drop = character(),
date_col = config$oot_date_col,
event_level = NULL,
export = NULL,
copy = TRUE
)
data |
A |
target |
Name of the target column (0/1, logical, or a two-level factor/character). |
config |
An object from |
drop |
Columns that are never candidates. They stay in the funnel as
|
date_col |
Date column of the out-of-time cut. Defaults to
|
event_level |
Which target value counts as the event; see |
export |
Directory to write the deliverables to. |
copy |
If |
An object of class scr_result. Read it with scr_selected(),
scr_funnel(), scr_gains(), scr_sql(), scr_leakage() and
summary(); continue with scr_scorecard(); write it with scr_export().
With the same data, the same target and the same config$seed, the
result is identical with one or several nthread: the seed governs the
random split, the cross-validation, the classifier subsample, the trees
and the bootstrap, and the binning is deterministic per column.
scr_run() for several targets straight from the database,
scr_scorecard() for the next step.
Other stages:
scr_align(),
scr_bin(),
scr_cutoff(),
scr_model(),
scr_reject(),
scr_scorecard(),
scr_split(),
scr_strategy(),
scr_triage()
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")
res
scr_selected(res)
head(scr_funnel(res, only_selected = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.