Nous.Eval.Optimizer.Evaluation (nous v0.21.1)

Copy Markdown View Source

One candidate profile evaluated on a batch of cases: what Nous.Eval.Optimizer.Adapter.evaluate/3 returns.

  • :profile_id - the evaluated Nous.Profile's id
  • :split - the split the batch was drawn from ("train", "val", "test") or "guard" for the guard-tagged cases the feasibility filter runs
  • :case_ids - the batch, in order
  • :scores - case id => the case's objective: the mean of its samples' gated case_score (Nous.Eval.Sample), where a sample that errored or was not scored counts 0.0. Errors never count as passes, and a case is never left out, so every candidate is scored on the same cases
  • :status - the run status (:completed, :budget_exhausted, :aborted); only a :completed evaluation is used for decisions
  • :feedback - the feedback policy its reflective records are rendered under (:diagnostic or :with_expected)
  • :cases - case id => Nous.Eval.Case, for the reflective records
  • :run - the Nous.Eval.Run behind it (samples, traces, summary)
  • :metric_calls / :tokens / :cost - what it spent: samples started, tokens, USD (nil when a request had no price)
  • :private - adapter-private data for reflective_records/2

Summary

Functions

The mean per-case score; 0.0 for an empty batch.

The evaluation restricted to case_ids (scores, cases and the run's samples). Used to read the guard-tagged cases out of a test evaluation.

The sum of the per-case scores (GEPA's minibatch objective).

Types

split()

@type split() :: String.t()

t()

@type t() :: %Nous.Eval.Optimizer.Evaluation{
  case_ids: [String.t()],
  cases: %{required(String.t()) => Nous.Eval.Case.t()},
  cost: float() | nil,
  feedback: :diagnostic | :with_expected,
  metric_calls: non_neg_integer(),
  private: map(),
  profile_id: String.t() | nil,
  run: Nous.Eval.Run.t() | nil,
  scores: %{required(String.t()) => float()},
  split: split(),
  status: Nous.Eval.Run.status(),
  tokens: non_neg_integer()
}

Functions

mean(evaluation)

@spec mean(t()) :: float()

The mean per-case score; 0.0 for an empty batch.

take(evaluation, case_ids, split)

@spec take(t(), [String.t()], split()) :: t()

The evaluation restricted to case_ids (scores, cases and the run's samples). Used to read the guard-tagged cases out of a test evaluation.

total(evaluation)

@spec total(t()) :: float()

The sum of the per-case scores (GEPA's minibatch objective).