Select one sweep candidate for promotion
Source:R/sweep.R, R/walk-forward-inspection.R
ledgr_candidate.RdSelects a single row from a sweep result table and packages its params, seed, and provenance for promotion or inspection.
Usage
ledgr_candidate(results, ...)
# Default S3 method
ledgr_candidate(results, which = 1L, allow_failed = FALSE, ...)
# S3 method for class 'ledgr_walk_forward_results'
ledgr_candidate(
results,
fold_seq,
selection_rationale = NULL,
snapshot = NULL,
...
)Arguments
- results
A
ledgr_sweep_resultsobject, a tibble-like object withcandidate_id,params,execution_seed, andprovenancecolumns, or aledgr_walk_forward_resultsobject.- ...
Method-specific arguments.
- which
Candidate selector. A character scalar selects by
candidate_id; an integer-like scalar selects by row position.- allow_failed
Logical. Failed candidates error by default.
- fold_seq
For walk-forward results, integer fold sequence to extract, or
"latest".- selection_rationale
Optional plain-text rationale. Required for walk-forward results when
fold_seq = "latest".- snapshot
Optional sealed snapshot override for walk-forward results whose experiment store has moved. The override must have the same
snapshot_idandsnapshot_hashas the result locator; itsdb_pathmay differ.
Details
The returned candidate carries selection_view, the tibble-like
view passed to ledgr_candidate(). Promotion-context storage uses that
view to record the filtered/sorted candidate table the user selected from.
ledgr_candidate() is the supported way to extract params, execution seed,
and row-level provenance for promotion. The selected candidate also carries
the compact reproduction key exposed by
ledgr_candidate_reproduction_key(). It avoids making users manually pull
params[[1]], execution_seed, and provenance fields from a tibble row.
Articles
Exploratory sweeps and promotion:
vignette("sweeps", package = "ledgr")
system.file("doc", "sweeps.html", package = "ledgr")