Converts a vitals scorer function into a per-example metric compatible with DSPrrr compilation and evaluation. The scorer is invoked on a single-row tibble constructed from the prediction and the expected row.
Usage
as_dsprrr_metric(
vitals_scorer,
input_column = "input",
target_column = "target",
result_column = "result"
)Arguments
- vitals_scorer
A function that accepts a tibble/data frame and returns a tibble with a
scorecolumn (following vitals conventions).- input_column
Name of the column to populate with the example input. If the column is absent in
expected_row,NAis supplied.- target_column
Name of the column holding the ground-truth label inside the vitals sample tibble.
- result_column
Name of the column that receives the model prediction.
