Creates a reduce function that scores each output using a metric function
and returns the best-scoring output. Requires expected value to be set
via the set_expected attribute before calling.
Value
A reduce function for use with ensemble()
Examples
if (FALSE) { # \dontrun{
# Score each output and return best
ens <- ensemble(
modules,
reduce_fn = reduce_best_by_metric(
metric = metric_exact_match(field = "answer")
)
)
} # }
