The per-case metrics Nous.Eval.Compare can gate on and break down by.
Every metric is a value per case in 0.0..1.0, so the unit of the paired
bootstrap is the case:
:pass_rate- the share of the case's scored (:pass/:fail) samples that passed:case_score- the mean of the samples' gatedcase_score(seeNous.Eval.Scoring){:scorer, name}- the share of the case's samples whose score namedname(aNous.Eval.Scorename such as"contains"or"judge.relevance") haspassed?: true, regardless of how scores are composed into the verdict
A metric is undefined for a case without the data it needs (no scored
sample, no case_score, no score of that name); such cases are left out
of that metric's comparison.
Command-line and config values are strings: "pass_rate",
"case_score" and "scorer:<name>" parse through a closed table, never
into new atoms.
Summary
Types
@type t() :: :pass_rate | :case_score | {:scorer, String.t()}
Functions
The string form of a metric (the inverse of parse/1).
Examples
iex> Nous.Eval.Compare.Metric.name({:scorer, "contains"})
"scorer:contains"
Validates a metric given as a term or a string.
Examples
iex> Nous.Eval.Compare.Metric.parse("scorer:judge.relevance")
{:ok, {:scorer, "judge.relevance"}}
iex> Nous.Eval.Compare.Metric.parse("accuracy")
{:error, {:invalid_metric, "accuracy"}}