Initialize an adaptive ranking session and canonical state object.
Usage
adaptive_rank_start(
items,
seed = 1L,
session_dir = NULL,
persist_item_log = FALSE,
...,
adaptive_config = NULL,
checkpoint_every_steps = NULL,
warm_start_model = NULL,
warm_start_prior = NULL,
warm_start_features = NULL,
warm_start_python = NULL,
warm_start_prior_sd = NULL,
warm_start_mode = NULL,
replay_reservoir = NULL,
warm_start_trueskill = NULL,
bootstrap_policy = "shuffled_connected"
)Arguments
- items
A vector or data frame of items. Data frames must include an
item_idcolumn (orid/ID). For linking run modes, items must also include integerset_idvalues and globally uniqueglobal_item_idvalues. Item IDs may be character; internal logs use integer indices derived from these IDs.- seed
Integer seed used for deterministic connected-bootstrap choices and selection randomness. Default is
1L.- session_dir
Optional directory for saving session artifacts. Default is
NULL.- persist_item_log
Logical; when TRUE, write per-refit item logs to disk. Default is
FALSE.- ...
Internal/testing only. Supply
now_fnto override the clock used for timestamps.- adaptive_config
Optional named list of adaptive controller overrides.
pairing_strategydefaults tohybrid;random,trueskill_p50, andtrueskill_pollittselect direct pairs after the configured connected bootstrap and currently requirerun_mode = "within_set". Unknown fields and invalid values abort with an actionable error. Seeadaptive_rank()for the full list of supported keys, detailed semantics, and defaults.- checkpoint_every_steps
Optional positive integer checkpoint cadence for ordinary live persistence. If
NULL, defaults to100L.- warm_start_model
Optional calibrated model, cross-task or same-task algorithm ensemble, path string, or loader reference list (
name/sourceorpath). Mutually exclusive withwarm_start_prior. Resolve and predict once when creating an assessment.- warm_start_prior
Optional
make_warm_start_prior()object covering all items. Saved numeric scores are centered within each BTL refit scope.- warm_start_features
Optional precomputed feature rows for model input; otherwise use item texts. Precomputed prediction needs neither Python nor a fitting backend.
- warm_start_python
Explicit Python interpreter for text extraction only.
- warm_start_prior_sd
Optional user-chosen raw theta prior SD for model input; scalar or per-item vector, default 0.5. Supplied prior objects retain their SDs. With
warm_start_trueskill = "predictive_distribution", explicit SD is required for model input, includingtrueskill_only, and also initializes TrueSkill sigma. Otherwisetrueskill_onlyrejects this argument.- warm_start_mode
Predictive destination:
cold(neither model),btl_only(BTL prior),trueskill_only(TrueSkill locations), orboth(both models). Omitted/NULL mode defaults tobtl_onlywith predictive input, otherwisecold. Requestbothexplicitly to initialize both models. In TrueSkill-warm modes, exact item-ID alignment precedesmu = mu0 + sigma0 * prior_mean, withmu0 = 25,sigma0 = 25/3, fixed multiplier 1, and unchanged sigma unlesswarm_start_trueskillexplicitly requests distribution initialization. Explicitcoldwith predictive input, or a non-cold mode without it, errors.- replay_reservoir
Optional
make_adaptive_replay_reservoir()object. Requires ordinary within-set mode and a matching reservoir replay judge. Uses a seeded spanning-tree bootstrap and at most one committed observation per allowed unordered edge, always in its frozen observed orientation. On resume, omit this argument or supply the identical reservoir.- warm_start_trueskill
Optional explicit uncertainty policy: NULL retains legacy initialization;
"predictive_distribution"requirestrueskill_onlyorbothand mapsmu = 25 + (25/3) * prior_meanandsigma = (25/3) * prior_sd, withbeta = 25/6. It overrides constructor means and sigmas, aligns by exact item ID, and never clips SD. Model input requires explicitwarm_start_prior_sd; prior objects use their stored SD. Named SD vectors align by ID; unnamed vectors follow prediction-input order. Omit this argument on resume; the saved distribution policy is authoritative.- bootstrap_policy
Initial graph policy, default
"shuffled_connected"."predictive_connected"requires a selectablereplay_reservoir, ordinary within-set mode,warm_start_trueskill = "predictive_distribution", andadaptive_config = list(pairing_strategy = "trueskill_pollitt"). Build the reservoir from selectable primary observations only, excluding held-out edges and reversal audits. The graph uses only manifest endpoints, frozen initial TrueSkill means/SDs, and the seed, never outcomes. The queue is built once before judging and retained across updates and resume. On wrapper resume, omit this argument or supply the saved policy; a different policy or explicit predictive initialization seed is rejected.
Value
An adaptive state object containing step_log, round_log, and
item_log. The object includes class "adaptive_state", item ID
mappings, TrueSkill state, frozen bootstrap policy/queue, refit metadata, and runtime
configuration.
Details
This function creates the stepwise controller state and seeds all canonical logs used in the adaptive pairing workflow. The default connected bootstrap uses a seeded shuffled chain, or a shuffled allowed tree for replay reservoirs. Either graph policy connects all items after \(N - 1\) committed comparisons.
Pair selection in this framework is stepwise and uncertainty-aware.
Within-set/Phase-A hybrid routing uses TrueSkill ranks, strata, rolling anchors,
pair probabilities, and base utility
$$U_0 = p_{ij}(1 - p_{ij})$$ where \(p_{ij}\) is the current TrueSkill
win probability for pair \(\{i, j\}\). Linking Phase A preparation requires
an explicit adaptive_config$link_estimation_mode. Adaptive Phase B selection
remains unavailable pending separate validation. Use prepare_link_input(),
fit_link(), and start_link_session() with explicit cross-set evidence and
frozen shared judge parameters for E1–E3 linking.
The within-set/Phase-A hybrid long-link gate uses TrueSkill throughout.
Bayesian BTL supplies item estimates, posterior uncertainty, EAP reliability,
diagnostics, stopping, and the existing global_identified signal. This signal
can affect later hybrid tapering and routing; selection is not wholly independent
of BTL. Direct within-set strategies use their documented partner targets after
the common bootstrap. Automatic Phase B selection is unavailable pending separate validation.
Linking Phase B refits use Bayesian posterior estimation and posterior
summaries/diagnostics are logged per spoke at each linking refit.
The returned state contains canonical logs:
step_log: one row per attempted step,round_log: one row per posterior refit,item_log: per-item posterior summaries by refit.
If session_dir is supplied, the initialized state is persisted
immediately using save_adaptive_session().
Predictive destinations and initial connectivity are separate choices.
By default, every warm mode retains the same seeded shuffled bootstrap of
N - 1 valid comparisons. The explicit predictive graph policy uses a frozen
allowed spanning tree with Pollitt probability targets and degree-cap
relaxation. Both policies preserve invalid-result retries and recorded
reservoir orientation. Later pairing retains the configured strategy.
When expressing budgets as mean comparison exposures per item, each committed
pair contributes two exposures. A prespecified rounding-down convention gives
floor(B * N / 2) total pairs, including bootstrap, with realized exposure
2 * committed_pairs / N. B = 0 is prior-only; B = 0.5 and B = 1 precede
connectivity and are not fully connected comparative-judgment estimates.
The tree completes at N - 1 successful commits; comparison N uses the
post-bootstrap strategy. Invalid attempts and retries do not add evidence.
See vignette("adaptive-warm-start") for the five-arm synthetic count example.
Without the distribution opt-in, BTL prior SD
does not determine TrueSkill sigma. Ensemble disagreement never supplies SD
automatically. No historical training-score units are restored.
Distribution initialization assumes the supplied BTL prior SD and TrueSkill
uncertainty describe comparable latent scales under the documented affine
convention. BTL priors apply to theta_raw; centering induces dependence, so
this is not the marginal SD of centered BTL effects and does not equate the
models' posteriors. Existing BTL identifiability and prior rules are unchanged.
Upstream predictive workflows must establish uncertainty calibration using
training data only; supplying SD explicitly does not establish calibration.
Scalar SD supports sensitivity analyses, not essay-specific calibration.
Saved metadata records the versioned mapping, SD source and scalar/per-item
rule, and integrity digests; calibration is recorded as upstream, unverified.
Predictive BTL priors apply only in btl_only and both, including run-required
linking Phase A. TrueSkill initialization applies in trueskill_only and both.
Imported Phase-A artifacts retain their own generation identity and are not
rerun because predictive input exists. Linking and pooled
judge refits keep their existing prior rules; predictive evidence is not
injected into Phase B priors, D-optimal selection, or probes.
Custom BTL fit functions should consume state$predictive_prior only when
state$meta$warm_start_mode is btl_only or both; its presence alone does
not imply BTL warming. Resume preserves saved predictions, current TrueSkill
state, mode, strategy, and bootstrap progress; omit all warm-start arguments.
Phase B linking restriction
Adaptive Phase B D-optimal selection is unavailable pending a separate
selector validation study. This includes all E1–E3 engines and legacy
D-optimal aliases; execution fails before selecting or judging a Phase B pair.
Phase A and ordinary within-set ranking remain available. For linking, use
prepare_link_input(), fit_link(), and start_link_session() with explicit
cross-set evidence and an explicit estimator choice.
See also
make_warm_start_prior(), adaptive_rank_run_live(), adaptive_rank_resume(),
adaptive_step_log(), adaptive_round_log(), adaptive_item_log()
Other adaptive ranking:
adaptive_rank(),
adaptive_rank_resume(),
adaptive_rank_run_live(),
make_adaptive_judge_llm(),
make_adaptive_judge_replay(),
make_adaptive_replay_reservoir(),
summarize_adaptive(),
validate_adaptive_replay()
Examples
state <- adaptive_rank_start(c("a", "b", "c"), seed = 11)
summarize_adaptive(state)
#> # A tibble: 1 × 6
#> n_items steps_attempted committed_pairs n_refits last_stop_decision
#> <int> <int> <int> <int> <lgl>
#> 1 3 0 0 0 FALSE
#> # ℹ 1 more variable: last_stop_reason <chr>
# Prior-only exposure checkpoint: B=0 commits no comparisons.
B <- c(0, 0.5, 1, 2)
data.frame(B = B, target_pairs = floor(B * length(state$item_ids) / 2))
#> B target_pairs
#> 1 0.0 0
#> 2 0.5 0
#> 3 1.0 1
#> 4 2.0 3