Dataset-agnostic eval runner. Given normalised Dataset.Instances and a recall_fun, it
scores each query with the gaming-resistant ranking metrics and aggregates overall and per
question_type.
recall_fun is injected so the same orchestration runs against the real
Ecto+pgvector+embedder pipeline (the honest measurement) or a deterministic stub (to unit
test the aggregation without a database). It receives a Dataset.Instance and returns the
recall response's results list (ranked, each result echoing metadata["eval_id"]).
Summary
Functions
Aggregate a list of per-query metric rows into means.
Render a report table (overall + per question_type) as a string.
Run the harness. Options: :k (nDCG/precision depth, default 10), :recall_k (default
5). Returns %{overall: metrics, by_type: %{type => metrics}, per_query: [...]} where
metrics is %{n, ndcg, mrr, recall}.
Types
@type recall_fun() :: (Foresight.Evals.Dataset.t() -> [map()])
Functions
Aggregate a list of per-query metric rows into means.
Render a report table (overall + per question_type) as a string.
@spec run([Foresight.Evals.Dataset.t()], recall_fun(), keyword()) :: map()
Run the harness. Options: :k (nDCG/precision depth, default 10), :recall_k (default
5). Returns %{overall: metrics, by_type: %{type => metrics}, per_query: [...]} where
metrics is %{n, ndcg, mrr, recall}.