Returns a new scr_result in which the accepted manual entries replace
the optimal ones inside fit (the automatic fit is frozen as
fit_auto), the screening and hold-out rows of those variables are
recomputed with the very same pipeline functions, the final shortlist is
the one implied by scr_classing_choose(), and the funnel, gains, SQL
and summary are rebuilt with a provenance column. scr_selected() on
the result returns the final list (which = "consensus" still gives the
automatic one). The ledger travels with the result and into
scr_scorecard() and scr_export(). The input result is not modified.
Arguments
- lab
An object from
scr_coarse_classing().
See also
scr_coarse_classing() for a complete session, from lab to
scorecard.
Other classing:
scr_classing_accept(),
scr_classing_choose(),
scr_classing_propose(),
scr_classing_spec(),
scr_classing_view(),
scr_coarse_classing(),
scr_decisions()
Examples
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")
res2 <- scr_classing_apply(lab)
scr_selected(res2)
#> [1] "vl_score_01" "vl_score_02" "ds_band" "ds_region" "vl_score_05"
#> [6] "vl_score_10"
scr_decisions(res2)
#> seq at author variable action proposal_id
#> <int> <POSc> <char> <char> <char> <char>
#> 1: 1 2026-10-02 00:02:38 runner ds_region accept P001
#> instruction
#> <char>
#> 1: groups = list(edge = c("NORTH", "SOUTH"), core = c("EAST", "WEST", "CENTRE"))
#> n_bins_before n_bins_after iv_train_before iv_train_after iv_holdout_before
#> <int> <int> <num> <num> <num>
#> 1: 5 2 0.08464808 0.07392963 0.09714339
#> iv_holdout_after psi_after verdict warnings
#> <num> <num> <char> <char>
#> 1: 0.07858917 0.0002621977 REVIEW IV_LOSS_VS_OPTIMAL
#> reason
#> <char>
#> 1: edge/core is what pricing uses
