| scr_run | R Documentation |
For each target: fetches the table, runs scr_select() and writes the
deliverables. A failure on one target is recorded and the loop continues.
scr_run(
con,
table,
targets,
config = scr_config(),
drop = character(),
date_col = config$oot_date_col,
event_level = NULL,
sample_frac = 1,
max_rows = NULL,
export = NULL
)
con |
A DBI connection, from |
table |
Table name, with an optional |
targets |
Vector with the names of the target columns. |
config |
An object from |
drop |
Columns that are never candidates. |
date_col |
Date column of the out-of-time split, passed on to
|
event_level |
Passed on to |
sample_frac |
Sampling fraction. A scalar or a list named by target. |
max_rows |
Row cap per target. |
export |
Root output directory; each target writes to a subdirectory. |
An scr_runset object: a named list of scr_result (or, for the
targets that failed, a list with error).
table accepts the {target} placeholder, replaced by the lower-case
target name. Without the placeholder, the same table is used for every
target.
scr_compare() and scr_core() to read the run set.
Other portfolio:
scr_compare(),
scr_core(),
scr_runset
con <- scr_connect(driver = RSQLite::SQLite(), dbname = ":memory:")
d <- scr_demo; d$ref_date <- as.character(d$ref_date) # SQLite has no Date type
DBI::dbWriteTable(con, "dtm", d)
cfg <- scr_config(verbose = FALSE, nthread = 1, use_ranger = FALSE,
xgb_rounds = 60, n_boot = 20)
rs <- scr_run(con, "dtm", targets = c("default", "churn"), config = cfg,
drop = c("id", "ref_date", "default", "churn"))
rs
scr_compare(rs)
DBI::dbDisconnect(con)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.