Skip to contents

Selects 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_results object, a tibble-like object with candidate_id, params, execution_seed, and provenance columns, or a ledgr_walk_forward_results object.

...

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_id and snapshot_hash as the result locator; its db_path may differ.

Value

A ledgr_sweep_candidate object.

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")