Skip to contents

Resolves a roster method to its score function and invokes it through the canonical adapter `function(model, X_rows, meta_rows) -> numeric`. New methods follow `score_*(model, X, meta = NULL)` directly; legacy ("present") methods MUST be dispatched through a shim registered with [singlesample_register_score_adapter()] (their argument order predates the canonical convention, so calling them positionally would mis-bind). Methods whose score function is not yet implemented raise an explicit not-yet-implemented error.

Usage

singlesample_score_call(
  method_id,
  model,
  X,
  meta = NULL,
  roster = singlesample_method_roster(),
  strict = FALSE
)

Arguments

method_id

Roster method identifier.

model

A fitted model object produced by the method's `fit_*` function.

X

Numeric matrix (samples x features), or a data frame coercible to one.

meta

Optional per-sample metadata (data frame with `nrow(X)` rows).

roster

The roster to resolve against; defaults to [singlesample_method_roster()].

strict

Logical scalar; defaults to FALSE. If TRUE, pass strict checking to built-in k-TSP, pair-ratio, trimmed-rCLR or balance-ILR scoring. Other methods, replaced roster scorers, and registered custom adapters fail with singlesample_input_error code STRICT_UNSUPPORTED. Required NA or non-finite values raise NONFINITE_REQUIRED_VALUE before dispatch in both modes. See [score_specimen()] for required features. Session-registered methods declaring `strict_support = TRUE` receive the strict flag through their registered callback.

Value

Numeric vector of one score per row of `X`, retaining any support attribute returned by the scorer.

See also

[singlesample_method_roster()], [singlesample_assert_row_equivariant()]