GEPA.Result (GEPA v0.3.0)

Copy Markdown View Source

Immutable result container for GEPA optimization.

Contains the final optimization state and provides convenient accessors for analysis.

Summary

Functions

Get the best candidate program.

Get the index of the best candidate by aggregate score.

Get the best score achieved.

Generate Graphviz DOT for this result's candidate lineage.

Generate a self-contained HTML visualization for this result's candidate lineage.

Rebuild a result from to_dict/1 output.

Create result from final optimization state.

Convert a result to a plain map suitable for persistence or JSON conversion.

Types

t()

@type t() :: %GEPA.Result{
  best_candidate: GEPA.Types.candidate() | term() | nil,
  best_idx: non_neg_integer() | nil,
  best_outputs_valset:
    %{required(GEPA.Types.data_id()) => [{GEPA.Types.program_idx(), term()}]}
    | nil,
  candidates: [GEPA.Types.candidate()],
  discovery_eval_counts: [non_neg_integer()],
  i: integer(),
  num_full_ds_evals: non_neg_integer(),
  objective_pareto_front: %{required(String.t()) => float()} | nil,
  parents: [[GEPA.Types.program_idx() | nil]],
  per_objective_best_candidates:
    %{required(String.t()) => MapSet.t(GEPA.Types.program_idx())} | nil,
  per_val_instance_best_candidates: GEPA.Types.pareto_fronts(),
  total_num_evals: non_neg_integer(),
  val_aggregate_scores: [float()],
  val_aggregate_subscores: [%{required(String.t()) => float()}] | nil,
  val_subscores: [GEPA.Types.sparse_scores()]
}

Functions

best_candidate(result)

@spec best_candidate(t()) :: GEPA.Types.candidate()

Get the best candidate program.

best_idx(result)

@spec best_idx(t()) :: non_neg_integer()

Get the index of the best candidate by aggregate score.

best_score(result)

@spec best_score(t()) :: float()

Get the best score achieved.

candidate_tree_dot(result)

@spec candidate_tree_dot(t()) :: String.t()

Generate Graphviz DOT for this result's candidate lineage.

candidate_tree_html(result)

@spec candidate_tree_html(t()) :: String.t()

Generate a self-contained HTML visualization for this result's candidate lineage.

from_dict(data)

@spec from_dict(map()) :: t()

Rebuild a result from to_dict/1 output.

from_state(state)

@spec from_state(GEPA.State.t()) :: t()

Create result from final optimization state.

to_dict(result)

@spec to_dict(t()) :: map()

Convert a result to a plain map suitable for persistence or JSON conversion.