easyiec.core.Feedback#

class easyiec.core.Feedback(query_id, kind, evaluator='unknown', selected=<factory>, keep=<factory>, ranking=<factory>, ratings=<factory>, pair_results=<factory>, best=None, worst=None, line_index=None, edits=<factory>, comment='', confidence=None, uncertainty=None, rationale='', stop=False, escalated=False, positions=<factory>, cost=<factory>, meta=<factory>, timestamp=<factory>)[source]#

Bases: object

An evaluator’s answer to a Query.

Only the fields of the query’s protocol need to be filled in; the remaining ones stay empty. Identifiers refer to Individual.id.

Attributes:
selectedlist of int

Chosen candidates (select; parents in EASY-IEC terms).

keeplist of int

Candidates to be carried over unchanged (user-driven elitism).

rankinglist of int

Best-to-worst order; a partial ranking lists the top only.

ratingsdict

{id: score} on the query scale.

pair_resultslist of (int, int, float)

(id_a, id_b, outcome) with outcome 1 (a wins), 0 (b wins), 0.5 (tie).

best, worstint, optional

best_worst answers.

line_indexint, optional

Index of the chosen sample of a line query.

editsdict

{id: new_genome} direct modifications.

commentstr

Free text (“brighter, less cluttered”); used for verbal steering.

confidencefloat, optional

Self-reported confidence in [0, 1].

uncertaintyfloat, optional

Evaluator-estimated uncertainty in [0, 1] (disagreement of panel members, inconsistency over permutations, …).

rationalestr

Explanation (LLM judges, people who type one).

stopbool

The evaluator is satisfied and ends the session.

escalatedbool

The answer was produced by a person after an AI escalation.

positionslist of int

Identifiers in the order in which they were displayed.

costdict

Effort spent (queries, decisions, tokens_in, tokens_out, usd, seconds, human).

metadict

Anything else (true_utility of simulated users, raw LLM output, member answers of a panel).

chosen(query)[source]#

The ‘winners’: selected/kept, the ranked top, the best, the line choice, pair winners.

order(query)[source]#

Candidates from best to worst (ties broken by display order).

to_pairs(query)[source]#

Weighted pairwise preferences (winner, loser, weight).

Ties appear in both directions with weight 0.5. select yields every chosen ≻ every unchosen; rank all ordered pairs of the ranked prefix and ranked ≻ unranked; rate every pair with different scores (weight proportional to the score difference); best_worst best ≻ others ≻ worst; line the chosen sample ≻ the other samples; edits add edited ≻ original (the edited individual carries meta['edited_from']).

utilities(query)[source]#

A utility in [0, 1] for every candidate of query.

select: 1 for chosen and kept, 0 otherwise; rank: normalized Borda score (unranked candidates share the lowest score); rate: normalized score; pairs: Copeland score (wins + ties/2 over comparisons); best_worst: 1, 0.5, 0; line: closeness in t to the chosen sample.

validate(query)[source]#

Check consistency with query and return self.