AnswerEvaluation#
- class scikitplot.corpus.AnswerEvaluation(metrics, items, judges, agreement, usage, errors, settings, metadata=<factory>)[source]#
Result of
evaluate_answers.- Parameters:
- metricsmapping
Metric name to the mean over items where it is defined.
- itemstuple of AnswerItem
Per-item results, in dataset order.
- judgesmapping
Judge name to
identity.- agreementmapping
Judge metric to Krippendorff’s alpha (interval) between the judges, when there are at least two;
NaNwhen undefined.- usagemapping
Judge name to
responses(model responses received),cached_responses,input_tokensandoutput_tokens(summed over responses that were not cached, so a cached rerun costs 0) andresponses_without_token_counts.- errorsmapping
Failures by kind:
"system"(items without an answer), then one count per judge (failed judgements), whether or not verdicts are kept.- settingsmapping
The options the evaluation ran with.
- metadatamapping, default={}
Free-form, JSON-compatible description supplied by the caller.
- Parameters:
- compare(baseline, *, n_resamples=10000, seed=0)[source]#
Compare with
baselineover the same items (paired sign-flip test).- Parameters:
- baselineAnswerEvaluation
Evaluation of the same item identifiers (another system, or another prompt of the same model).
- n_resamples, seedint
As in
RetrievalEvaluation.compare.
- Returns:
- EvaluationComparison
- Raises:
- TypeError
If
baselineis not anAnswerEvaluation.- ValueError
If the item sets differ or no metric is shared.
- Parameters:
baseline (AnswerEvaluation)
n_resamples (int)
seed (int)
- Return type:
Notes
Compare evaluations scored by the same judges: a judge identity that differs between the two reports makes the difference partly the judges’.
comparedoes not refuse it; checkjudges.
- classmethod from_dict(data)[source]#
Rebuild a report from
to_dictoutput.- Raises:
- ValueError
If the schema or its version is not this one.
- Parameters:
- Return type:
- classmethod read(path, format=None)[source]#
Read a report written by
writein JSON, YAML or TOML.- Parameters:
- Return type: