Skip to contents

Fits one rostered single-sample method and returns a frozen deployment object that can score one incoming specimen without a scored batch, co-resident reference cohort, or batch-correction step. This is a deployability API, not a benchmark-ranking claim: the default "ws-balance-ilr" is a reasonable compositional default, not a certified winner. It does not assert that any single-sample method out-discriminates a batch-corrected pipeline; validate the method choice on your own data.

Reticulate methods (roster tier R2; require a Python backend / venv) are intentionally not fitted by this base-R deployment wrapper.

Usage

deploy_singlesample(
  X_train,
  y_train,
  method = "ws-balance-ilr",
  meta_train = NULL,
  annotation = NULL,
  verify = TRUE
)

Arguments

X_train

Numeric matrix or data frame of training specimens (samples x features).

y_train

Numeric/integer 0/1 labels aligned to X_train.

method

Method identifier from singlesample_method_roster.

meta_train

Optional training metadata, one row per training specimen.

annotation

Optional feature annotation passed only to methods whose fit signature includes an annotation argument.

verify

Logical; if TRUE, run singlesample_assert_row_equivariant on the training rows (or a deterministic subset for large inputs) so construction fails loudly when the fitted scorer is not single-sample deployable.

Value

An S3 object of class singlesample_deployable containing the frozen model, method_id, resolved score_fn, n_train, fit_time, and roster meta. Its value is deployability: scoring an incoming specimen from that specimen plus frozen fit-time parameters only.