evalsuite-python 1.2.0__py3-none-any.whl → 1.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
evalsuite/__init__.py CHANGED
@@ -3,337 +3,1049 @@
3
3
  >>> import evalsuite as es
4
4
  >>> result = es.evaluate([0, 1, 1, 0], [0, 1, 0, 0])
5
5
  >>> print(result.summary()) # doctest: +SKIP
6
+
7
+ Importing EvalSuite loads almost nothing: every function, class and submodule below is imported the first time
8
+ it is used (PEP 562), so ``import evalsuite`` stays fast and only the parts a program touches are ever loaded.
6
9
  """
7
10
 
8
- from . import calibration, classification, clinical, llmsys, plot, regression, stats, text, vision
9
- from .api import evaluate
10
- from .calibration import (
11
- CalibrationReport,
12
- calibration_intercept,
13
- calibration_report,
14
- calibration_slope,
15
- hosmer_lemeshow,
16
- maximum_calibration_error,
17
- )
18
- from .cards import ReportCard, report_card
19
- from .classification import (
20
- accuracy,
21
- average_precision,
22
- balanced_accuracy,
23
- brier_score,
24
- calibration_curve,
25
- cohen_kappa,
26
- confusion_matrix,
27
- expected_calibration_error,
28
- f1,
29
- fbeta,
30
- hamming_loss,
31
- jaccard,
32
- log_loss,
33
- mcc,
34
- npv,
35
- pr_curve,
36
- precision,
37
- recall,
38
- roc_auc,
39
- roc_curve,
40
- specificity,
41
- top_k_accuracy,
42
- )
43
- from .clinical import (
44
- DecisionCurve,
45
- DiagnosticReport,
46
- decision_curve,
47
- diagnostic_odds_ratio,
48
- diagnostic_report,
49
- lr_negative,
50
- lr_positive,
51
- net_benefit,
52
- ppv,
53
- sensitivity,
54
- youden_j,
55
- )
56
- from .core.exceptions import (
57
- EvalSuiteError,
58
- InputValidationError,
59
- MetricInputError,
60
- OptionalDependencyError,
61
- StatisticalTestError,
62
- UndefinedMetricWarning,
63
- UnsupportedTaskError,
64
- )
65
- from .core.registry import MetricInfo, list_metrics, metric_info
66
- from .core.result import EvaluationResult, MetricResult
67
- from .harness import Leaderboard, leaderboard
68
- from .llmsys import * # noqa: F403 (v0.5.0 LLM-systems functions, listed in llmsys.__all__)
69
- from .llmsys import __all__ as _llmsys_all
70
- from .monitor import Alert, Monitor, ks_drift, population_stability_index
71
- from .regression import (
72
- adjusted_r2,
73
- explained_variance,
74
- huber_loss,
75
- mae,
76
- mape,
77
- max_error,
78
- mean_bias_error,
79
- median_absolute_error,
80
- mse,
81
- msle,
82
- quantile_loss,
83
- r2,
84
- rae,
85
- rmse,
86
- rmsle,
87
- rse,
88
- smape,
89
- )
90
- from .reporting import ClassificationReport, classification_report
91
- from .stats import (
92
- ComparisonResult,
93
- ConfidenceInterval,
94
- TestResult,
95
- accuracy_ci,
96
- adjust_pvalues,
97
- bootstrap_ci,
98
- chi_square_test,
99
- cliffs_delta,
100
- cohens_d,
101
- compare,
102
- cramers_v,
103
- delong_test,
104
- fisher_exact_test,
105
- friedman_test,
106
- hedges_g,
107
- kruskal_wallis_test,
108
- mann_whitney_test,
109
- mcnemar_test,
110
- paired_bootstrap_test,
111
- paired_t_test,
112
- proportion_ci,
113
- roc_auc_ci,
114
- shapiro_wilk_test,
115
- t_test,
116
- wilcoxon_test,
117
- )
118
- from .text import * # noqa: F403 (every LLM-evaluation function, listed in text.__all__)
119
- from .text import __all__ as _text_all
11
+ from __future__ import annotations
12
+
13
+ import contextlib as _contextlib
14
+ import importlib as _importlib
15
+ import sys as _sys
16
+ import types as _types
17
+ from typing import TYPE_CHECKING, Any
18
+
120
19
  from .version import __version__
121
- from .vision import (
122
- DetectionReport,
123
- SegmentationReport,
124
- average_precision_detection,
125
- average_surface_distance,
126
- boundary_iou,
127
- box_iou,
128
- detection_pr_curve,
129
- detection_report,
130
- dice,
131
- from_coco,
132
- hausdorff_distance,
133
- iou,
134
- mean_average_precision,
135
- mean_pixel_accuracy,
136
- miou,
137
- per_image_scores,
138
- pixel_accuracy,
139
- segmentation_confusion,
140
- segmentation_report,
141
- )
142
20
 
143
- __all__ = [
144
- "text",
145
- "llmsys",
146
- "SegmentationReport",
147
- "segmentation_report",
148
- "detection_pr_curve",
149
- "vision",
150
- "DetectionReport",
151
- "average_precision_detection",
152
- "average_surface_distance",
153
- "boundary_iou",
154
- "box_iou",
155
- "detection_report",
156
- "dice",
157
- "from_coco",
158
- "hausdorff_distance",
159
- "iou",
160
- "mean_average_precision",
161
- "mean_pixel_accuracy",
162
- "miou",
163
- "per_image_scores",
164
- "pixel_accuracy",
165
- "segmentation_confusion",
166
- "CalibrationReport",
167
- "calibration_report",
21
+ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
22
+ from . import (
23
+ calibration,
24
+ classification,
25
+ clinical,
26
+ llmsys,
27
+ plot,
28
+ regression,
29
+ stats,
30
+ text,
31
+ vision,
32
+ )
33
+ from .agreement import (
34
+ BlandAltman,
35
+ ICCForm,
36
+ ICCResult,
37
+ bland_altman,
38
+ icc,
39
+ lins_ccc,
40
+ )
41
+ from .api import (
42
+ evaluate,
43
+ )
44
+ from .bayes import (
45
+ BayesComparison,
46
+ bayes_compare,
47
+ bayes_correlated_ttest,
48
+ )
49
+ from .calibration import (
50
+ CalibrationReport,
51
+ calibration_intercept,
52
+ calibration_report,
53
+ calibration_slope,
54
+ hosmer_lemeshow,
55
+ maximum_calibration_error,
56
+ )
57
+ from .cards import (
58
+ ReportCard,
59
+ report_card,
60
+ )
61
+ from .classification import (
62
+ accuracy,
63
+ average_precision,
64
+ balanced_accuracy,
65
+ brier_score,
66
+ calibration_curve,
67
+ cohen_kappa,
68
+ confusion_matrix,
69
+ expected_calibration_error,
70
+ f1,
71
+ fbeta,
72
+ hamming_loss,
73
+ jaccard,
74
+ log_loss,
75
+ mcc,
76
+ npv,
77
+ pr_curve,
78
+ precision,
79
+ recall,
80
+ roc_auc,
81
+ roc_curve,
82
+ specificity,
83
+ top_k_accuracy,
84
+ )
85
+ from .clinical import (
86
+ DecisionCurve,
87
+ DiagnosticReport,
88
+ decision_curve,
89
+ diagnostic_odds_ratio,
90
+ diagnostic_report,
91
+ lr_negative,
92
+ lr_positive,
93
+ net_benefit,
94
+ ppv,
95
+ sensitivity,
96
+ youden_j,
97
+ )
98
+ from .core.exceptions import (
99
+ EvalSuiteError,
100
+ InputValidationError,
101
+ MetricInputError,
102
+ OptionalDependencyError,
103
+ StatisticalTestError,
104
+ UndefinedMetricWarning,
105
+ UnsupportedTaskError,
106
+ )
107
+ from .core.registry import (
108
+ MetricInfo,
109
+ list_metrics,
110
+ metric_info,
111
+ )
112
+ from .core.result import (
113
+ EvaluationResult,
114
+ MetricResult,
115
+ )
116
+ from .drift import (
117
+ DriftReport,
118
+ drift_report,
119
+ )
120
+ from .fairness import (
121
+ FairnessReport,
122
+ fairness_report,
123
+ )
124
+ from .forecasting import (
125
+ ForecastReport,
126
+ crps,
127
+ diebold_mariano,
128
+ forecast_report,
129
+ interval_coverage,
130
+ interval_score,
131
+ mase,
132
+ msis,
133
+ pinball_loss,
134
+ rmsse,
135
+ )
136
+ from .harness import (
137
+ Leaderboard,
138
+ leaderboard,
139
+ )
140
+ from .html_report import (
141
+ html_report,
142
+ )
143
+ from .judging import (
144
+ JudgeReport,
145
+ RubricReport,
146
+ judge_report,
147
+ rubric_report,
148
+ )
149
+ from .llm_benchmarks import (
150
+ BENCHMARKS,
151
+ format_multiple_choice,
152
+ load_benchmark,
153
+ )
154
+ from .llmsys import *
155
+ from .monitor import (
156
+ Alert,
157
+ Monitor,
158
+ ks_drift,
159
+ population_stability_index,
160
+ )
161
+ from .multilabel import (
162
+ MultilabelReport,
163
+ RankingReport,
164
+ multilabel_report,
165
+ ranking_report,
166
+ )
167
+ from .rag_report import (
168
+ RAGReport,
169
+ rag_report,
170
+ )
171
+ from .recalibration import (
172
+ Calibrator,
173
+ recalibrate,
174
+ )
175
+ from .regression import (
176
+ adjusted_r2,
177
+ explained_variance,
178
+ huber_loss,
179
+ mae,
180
+ mape,
181
+ max_error,
182
+ mean_bias_error,
183
+ median_absolute_error,
184
+ mse,
185
+ msle,
186
+ quantile_loss,
187
+ r2,
188
+ rae,
189
+ rmse,
190
+ rmsle,
191
+ rse,
192
+ smape,
193
+ )
194
+ from .reporting import (
195
+ ClassificationReport,
196
+ classification_report,
197
+ )
198
+ from .stats import (
199
+ ComparisonResult,
200
+ ConfidenceInterval,
201
+ TestResult,
202
+ accuracy_ci,
203
+ adjust_pvalues,
204
+ bootstrap_ci,
205
+ chi_square_test,
206
+ cliffs_delta,
207
+ cohens_d,
208
+ compare,
209
+ cramers_v,
210
+ delong_test,
211
+ fisher_exact_test,
212
+ friedman_test,
213
+ hedges_g,
214
+ kruskal_wallis_test,
215
+ mann_whitney_test,
216
+ mcnemar_test,
217
+ paired_bootstrap_test,
218
+ paired_t_test,
219
+ proportion_ci,
220
+ roc_auc_ci,
221
+ shapiro_wilk_test,
222
+ t_test,
223
+ wilcoxon_test,
224
+ )
225
+ from .stats.planning import (
226
+ SampleSize,
227
+ power_auc,
228
+ power_mean_difference,
229
+ power_two_proportions,
230
+ sample_size_auc,
231
+ sample_size_mean_difference,
232
+ sample_size_proportion,
233
+ sample_size_two_proportions,
234
+ )
235
+ from .survival import (
236
+ brier_score_survival,
237
+ concordance_index,
238
+ integrated_brier_score,
239
+ kaplan_meier,
240
+ time_dependent_auc,
241
+ )
242
+ from .text import *
243
+ from .vision import (
244
+ DetectionReport,
245
+ SegmentationReport,
246
+ average_precision_detection,
247
+ average_surface_distance,
248
+ boundary_iou,
249
+ box_iou,
250
+ detection_pr_curve,
251
+ detection_report,
252
+ dice,
253
+ from_coco,
254
+ hausdorff_distance,
255
+ iou,
256
+ mean_average_precision,
257
+ mean_pixel_accuracy,
258
+ miou,
259
+ per_image_scores,
260
+ pixel_accuracy,
261
+ segmentation_confusion,
262
+ segmentation_report,
263
+ )
264
+
265
+ # Submodules available as attributes (``es.stats``, ``es.plot``, ...).
266
+ _SUBMODULES = (
168
267
  "calibration",
268
+ "classification",
169
269
  "clinical",
170
- "calibration_intercept",
171
- "calibration_slope",
172
- "hosmer_lemeshow",
173
- "maximum_calibration_error",
174
- "DecisionCurve",
175
- "DiagnosticReport",
176
- "decision_curve",
177
- "diagnostic_odds_ratio",
178
- "diagnostic_report",
179
- "lr_negative",
180
- "lr_positive",
181
- "net_benefit",
182
- "ppv",
183
- "sensitivity",
184
- "youden_j",
185
- "chi_square_test",
186
- "cramers_v",
187
- "fisher_exact_test",
188
- "friedman_test",
189
- "kruskal_wallis_test",
190
- "mann_whitney_test",
191
- "paired_t_test",
192
- "shapiro_wilk_test",
193
- "t_test",
194
- "wilcoxon_test",
270
+ "llmsys",
195
271
  "plot",
196
- "expected_calibration_error",
197
- "calibration_curve",
198
- "classification_report",
199
- "ClassificationReport",
272
+ "regression",
200
273
  "stats",
201
- "roc_auc_ci",
202
- "report_card",
203
- "ReportCard",
204
- "proportion_ci",
205
- "paired_bootstrap_test",
206
- "mcnemar_test",
207
- "hedges_g",
208
- "delong_test",
209
- "compare",
210
- "cohens_d",
211
- "cliffs_delta",
212
- "bootstrap_ci",
213
- "adjust_pvalues",
214
- "accuracy_ci",
215
- "TestResult",
216
- "ConfidenceInterval",
274
+ "text",
275
+ "vision",
276
+ )
277
+
278
+ # Public name -> the submodule that defines it.
279
+ _EXPORTS: dict[str, tuple[str, ...]] = {
280
+ ".api": ("evaluate",),
281
+ ".calibration": (
282
+ "CalibrationReport",
283
+ "calibration_intercept",
284
+ "calibration_report",
285
+ "calibration_slope",
286
+ "hosmer_lemeshow",
287
+ "maximum_calibration_error",
288
+ ),
289
+ ".cards": (
290
+ "ReportCard",
291
+ "report_card",
292
+ ),
293
+ ".classification": (
294
+ "accuracy",
295
+ "average_precision",
296
+ "balanced_accuracy",
297
+ "brier_score",
298
+ "calibration_curve",
299
+ "cohen_kappa",
300
+ "confusion_matrix",
301
+ "expected_calibration_error",
302
+ "f1",
303
+ "fbeta",
304
+ "hamming_loss",
305
+ "jaccard",
306
+ "log_loss",
307
+ "mcc",
308
+ "npv",
309
+ "pr_curve",
310
+ "precision",
311
+ "recall",
312
+ "roc_auc",
313
+ "roc_curve",
314
+ "specificity",
315
+ "top_k_accuracy",
316
+ ),
317
+ ".clinical": (
318
+ "DecisionCurve",
319
+ "DiagnosticReport",
320
+ "decision_curve",
321
+ "diagnostic_odds_ratio",
322
+ "diagnostic_report",
323
+ "lr_negative",
324
+ "lr_positive",
325
+ "net_benefit",
326
+ "ppv",
327
+ "sensitivity",
328
+ "youden_j",
329
+ ),
330
+ ".core.exceptions": (
331
+ "EvalSuiteError",
332
+ "InputValidationError",
333
+ "MetricInputError",
334
+ "OptionalDependencyError",
335
+ "StatisticalTestError",
336
+ "UndefinedMetricWarning",
337
+ "UnsupportedTaskError",
338
+ ),
339
+ ".core.registry": (
340
+ "MetricInfo",
341
+ "list_metrics",
342
+ "metric_info",
343
+ ),
344
+ ".core.result": (
345
+ "EvaluationResult",
346
+ "MetricResult",
347
+ ),
348
+ ".agreement": (
349
+ "BlandAltman",
350
+ "ICCForm",
351
+ "ICCResult",
352
+ "bland_altman",
353
+ "icc",
354
+ "lins_ccc",
355
+ ),
356
+ ".bayes": (
357
+ "BayesComparison",
358
+ "bayes_compare",
359
+ "bayes_correlated_ttest",
360
+ ),
361
+ ".drift": (
362
+ "DriftReport",
363
+ "drift_report",
364
+ ),
365
+ ".forecasting": (
366
+ "ForecastReport",
367
+ "crps",
368
+ "diebold_mariano",
369
+ "forecast_report",
370
+ "interval_coverage",
371
+ "interval_score",
372
+ "mase",
373
+ "msis",
374
+ "pinball_loss",
375
+ "rmsse",
376
+ ),
377
+ ".multilabel": (
378
+ "MultilabelReport",
379
+ "RankingReport",
380
+ "multilabel_report",
381
+ "ranking_report",
382
+ ),
383
+ ".recalibration": (
384
+ "Calibrator",
385
+ "recalibrate",
386
+ ),
387
+ ".fairness": (
388
+ "FairnessReport",
389
+ "fairness_report",
390
+ ),
391
+ ".harness": (
392
+ "Leaderboard",
393
+ "leaderboard",
394
+ ),
395
+ ".html_report": ("html_report",),
396
+ ".judging": (
397
+ "JudgeReport",
398
+ "RubricReport",
399
+ "judge_report",
400
+ "rubric_report",
401
+ ),
402
+ ".llm_benchmarks": (
403
+ "BENCHMARKS",
404
+ "format_multiple_choice",
405
+ "load_benchmark",
406
+ ),
407
+ ".llmsys": (
408
+ "PII_PATTERNS",
409
+ "PYTHON_KEYWORDS",
410
+ "adaptive_calibration_error",
411
+ "add_typos",
412
+ "adversarial_robustness",
413
+ "agent_cost_per_task",
414
+ "attack_success_rate",
415
+ "aurc",
416
+ "availability",
417
+ "bitext_mining_accuracy",
418
+ "citation_coverage",
419
+ "code_complexity",
420
+ "code_switching_robustness",
421
+ "codebleu",
422
+ "compression_ratio",
423
+ "confidence_accuracy_correlation",
424
+ "context_utilization",
425
+ "contradiction_rate",
426
+ "coverage_at_risk",
427
+ "coverage_rate",
428
+ "cross_document_consistency",
429
+ "cross_lingual_consistency",
430
+ "cultural_appropriateness",
431
+ "detect_pii",
432
+ "direct_assessment",
433
+ "distribution_shift_drop",
434
+ "energy_per_request",
435
+ "error_rate",
436
+ "execution_success_rate",
437
+ "exposure",
438
+ "harmful_response_rate",
439
+ "human_intervention_rate",
440
+ "inference_cost",
441
+ "invalid_tool_call_rate",
442
+ "invariance_violation_rate",
443
+ "language_consistency",
444
+ "language_id_accuracy",
445
+ "language_parity",
446
+ "latency_percentiles",
447
+ "lost_in_the_middle",
448
+ "needle_in_haystack",
449
+ "noise_robustness",
450
+ "ood_accuracy",
451
+ "over_refusal_rate",
452
+ "paraphrase_consistency",
453
+ "patch_acceptance_rate",
454
+ "pii_leakage_rate",
455
+ "plan_adherence",
456
+ "policy_violation_rate",
457
+ "position_accuracy",
458
+ "prompt_sensitivity",
459
+ "recovery_success_rate",
460
+ "red_team_success_rate",
461
+ "refusal_rate",
462
+ "requests_per_second",
463
+ "resolved_rate",
464
+ "resource_utilization",
465
+ "response_stability",
466
+ "retrieval_accuracy_by_length",
467
+ "risk_at_coverage",
468
+ "risk_coverage_curve",
469
+ "runtime_efficiency",
470
+ "security_vulnerability_rate",
471
+ "selective_risk",
472
+ "state_tracking_accuracy",
473
+ "static_analysis_violation_rate",
474
+ "steps_per_task",
475
+ "stereotype_preference",
476
+ "summary_coverage",
477
+ "syntax_validity_rate",
478
+ "task_completion_rate",
479
+ "throughput",
480
+ "time_per_output_token",
481
+ "time_to_first_token",
482
+ "token_usage",
483
+ "tool_failure_recovery_rate",
484
+ "tool_use_efficiency",
485
+ "toxicity_score",
486
+ "truncation_sensitivity",
487
+ "unit_test_pass_rate",
488
+ "unnecessary_tool_call_rate",
489
+ "weat_effect_size",
490
+ ),
491
+ ".monitor": (
492
+ "Alert",
493
+ "Monitor",
494
+ "ks_drift",
495
+ "population_stability_index",
496
+ ),
497
+ ".rag_report": (
498
+ "RAGReport",
499
+ "rag_report",
500
+ ),
501
+ ".regression": (
502
+ "adjusted_r2",
503
+ "explained_variance",
504
+ "huber_loss",
505
+ "mae",
506
+ "mape",
507
+ "max_error",
508
+ "mean_bias_error",
509
+ "median_absolute_error",
510
+ "mse",
511
+ "msle",
512
+ "quantile_loss",
513
+ "r2",
514
+ "rae",
515
+ "rmse",
516
+ "rmsle",
517
+ "rse",
518
+ "smape",
519
+ ),
520
+ ".reporting": (
521
+ "ClassificationReport",
522
+ "classification_report",
523
+ ),
524
+ ".stats": (
525
+ "ComparisonResult",
526
+ "ConfidenceInterval",
527
+ "TestResult",
528
+ "accuracy_ci",
529
+ "adjust_pvalues",
530
+ "bootstrap_ci",
531
+ "chi_square_test",
532
+ "cliffs_delta",
533
+ "cohens_d",
534
+ "compare",
535
+ "cramers_v",
536
+ "delong_test",
537
+ "fisher_exact_test",
538
+ "friedman_test",
539
+ "hedges_g",
540
+ "kruskal_wallis_test",
541
+ "mann_whitney_test",
542
+ "mcnemar_test",
543
+ "paired_bootstrap_test",
544
+ "paired_t_test",
545
+ "proportion_ci",
546
+ "roc_auc_ci",
547
+ "shapiro_wilk_test",
548
+ "t_test",
549
+ "wilcoxon_test",
550
+ ),
551
+ ".stats.planning": (
552
+ "SampleSize",
553
+ "power_auc",
554
+ "power_mean_difference",
555
+ "power_two_proportions",
556
+ "sample_size_auc",
557
+ "sample_size_mean_difference",
558
+ "sample_size_proportion",
559
+ "sample_size_two_proportions",
560
+ ),
561
+ ".survival": (
562
+ "brier_score_survival",
563
+ "concordance_index",
564
+ "integrated_brier_score",
565
+ "kaplan_meier",
566
+ "time_dependent_auc",
567
+ ),
568
+ ".text": (
569
+ "TextReport",
570
+ "abstention_accuracy",
571
+ "answer_correctness",
572
+ "answer_relevance",
573
+ "api_call_success_rate",
574
+ "benchmark_accuracy",
575
+ "bertscore",
576
+ "bleu",
577
+ "bradley_terry",
578
+ "chrf",
579
+ "cider",
580
+ "citation_precision",
581
+ "citation_recall",
582
+ "claim_verification_accuracy",
583
+ "constraint_satisfaction_rate",
584
+ "context_precision",
585
+ "context_recall",
586
+ "context_relevance",
587
+ "cross_entropy",
588
+ "distinct_n",
589
+ "elo_ratings",
590
+ "embedding_similarity",
591
+ "exact_match",
592
+ "extra_content_rate",
593
+ "extract_answer",
594
+ "extract_json",
595
+ "failure_attribution",
596
+ "faithfulness",
597
+ "fleiss_kappa",
598
+ "format_compliance",
599
+ "groundedness",
600
+ "hallucination_rate",
601
+ "hit_rate_at_k",
602
+ "instruction_compliance_rate",
603
+ "instruction_retention",
604
+ "json_schema_compliance",
605
+ "json_validity",
606
+ "judge_agreement",
607
+ "knowledge_consistency",
608
+ "krippendorff_alpha",
609
+ "latency_summary",
610
+ "majority_vote_accuracy",
611
+ "mauve",
612
+ "mean_average_precision_at_k",
613
+ "meteor",
614
+ "model_score",
615
+ "moverscore",
616
+ "mrr",
617
+ "ndcg_at_k",
618
+ "normalize_answer",
619
+ "pass_at_k",
620
+ "perplexity",
621
+ "position_consistency",
622
+ "precision_at_k",
623
+ "recall_at_k",
624
+ "required_field_accuracy",
625
+ "rouge_1",
626
+ "rouge_2",
627
+ "rouge_l",
628
+ "rouge_lsum",
629
+ "rubric_score",
630
+ "self_bleu",
631
+ "self_preference_bias",
632
+ "sentence_bleu",
633
+ "spice",
634
+ "task_success_rate",
635
+ "ter",
636
+ "text_report",
637
+ "token_f1",
638
+ "tool_argument_accuracy",
639
+ "tool_call_f1",
640
+ "tool_selection_accuracy",
641
+ "validate_json_schema",
642
+ "verbosity_bias",
643
+ "win_rate",
644
+ "xml_validity",
645
+ ),
646
+ ".vision": (
647
+ "DetectionReport",
648
+ "SegmentationReport",
649
+ "average_precision_detection",
650
+ "average_surface_distance",
651
+ "boundary_iou",
652
+ "box_iou",
653
+ "detection_pr_curve",
654
+ "detection_report",
655
+ "dice",
656
+ "from_coco",
657
+ "hausdorff_distance",
658
+ "iou",
659
+ "mean_average_precision",
660
+ "mean_pixel_accuracy",
661
+ "miou",
662
+ "per_image_scores",
663
+ "pixel_accuracy",
664
+ "segmentation_confusion",
665
+ "segmentation_report",
666
+ ),
667
+ }
668
+
669
+ _LAZY: dict[str, str] = {name: mod for mod, names in _EXPORTS.items() for name in names}
670
+ _LAZY.update({"UpdateInfo": "._update", "check_for_update": "._update", "upgrade": "._update"})
671
+
672
+ __all__ = [
673
+ "Alert",
674
+ "BENCHMARKS",
675
+ "BayesComparison",
676
+ "BlandAltman",
677
+ "CalibrationReport",
678
+ "Calibrator",
679
+ "ClassificationReport",
217
680
  "ComparisonResult",
681
+ "ConfidenceInterval",
682
+ "DecisionCurve",
683
+ "DetectionReport",
684
+ "DiagnosticReport",
685
+ "DriftReport",
218
686
  "EvalSuiteError",
219
687
  "EvaluationResult",
688
+ "FairnessReport",
689
+ "ForecastReport",
690
+ "ICCForm",
691
+ "ICCResult",
220
692
  "InputValidationError",
693
+ "JudgeReport",
694
+ "Leaderboard",
221
695
  "MetricInfo",
222
696
  "MetricInputError",
223
697
  "MetricResult",
698
+ "Monitor",
699
+ "MultilabelReport",
224
700
  "OptionalDependencyError",
701
+ "PII_PATTERNS",
702
+ "PYTHON_KEYWORDS",
703
+ "RAGReport",
704
+ "RankingReport",
705
+ "ReportCard",
706
+ "RubricReport",
707
+ "SampleSize",
708
+ "SegmentationReport",
225
709
  "StatisticalTestError",
710
+ "TestResult",
711
+ "TextReport",
226
712
  "UndefinedMetricWarning",
227
713
  "UnsupportedTaskError",
714
+ "UpdateInfo",
228
715
  "__version__",
716
+ "abstention_accuracy",
229
717
  "accuracy",
718
+ "accuracy_ci",
719
+ "adaptive_calibration_error",
720
+ "add_typos",
721
+ "adjust_pvalues",
230
722
  "adjusted_r2",
723
+ "adversarial_robustness",
724
+ "agent_cost_per_task",
725
+ "answer_correctness",
726
+ "answer_relevance",
727
+ "api_call_success_rate",
728
+ "attack_success_rate",
729
+ "aurc",
730
+ "availability",
231
731
  "average_precision",
732
+ "average_precision_detection",
733
+ "average_surface_distance",
232
734
  "balanced_accuracy",
735
+ "bayes_compare",
736
+ "bayes_correlated_ttest",
737
+ "benchmark_accuracy",
738
+ "bertscore",
739
+ "bitext_mining_accuracy",
740
+ "bland_altman",
741
+ "bleu",
742
+ "bootstrap_ci",
743
+ "boundary_iou",
744
+ "box_iou",
745
+ "bradley_terry",
233
746
  "brier_score",
747
+ "brier_score_survival",
748
+ "calibration",
749
+ "calibration_curve",
750
+ "calibration_intercept",
751
+ "calibration_report",
752
+ "calibration_slope",
753
+ "check_for_update",
754
+ "chi_square_test",
755
+ "chrf",
756
+ "cider",
757
+ "citation_coverage",
758
+ "citation_precision",
759
+ "citation_recall",
760
+ "claim_verification_accuracy",
234
761
  "classification",
762
+ "classification_report",
763
+ "cliffs_delta",
764
+ "clinical",
765
+ "code_complexity",
766
+ "code_switching_robustness",
767
+ "codebleu",
235
768
  "cohen_kappa",
769
+ "cohens_d",
770
+ "compare",
771
+ "compression_ratio",
772
+ "concordance_index",
773
+ "confidence_accuracy_correlation",
236
774
  "confusion_matrix",
775
+ "constraint_satisfaction_rate",
776
+ "context_precision",
777
+ "context_recall",
778
+ "context_relevance",
779
+ "context_utilization",
780
+ "contradiction_rate",
781
+ "coverage_at_risk",
782
+ "coverage_rate",
783
+ "cramers_v",
784
+ "cross_document_consistency",
785
+ "cross_entropy",
786
+ "cross_lingual_consistency",
787
+ "crps",
788
+ "cultural_appropriateness",
789
+ "decision_curve",
790
+ "delong_test",
791
+ "detect_pii",
792
+ "detection_pr_curve",
793
+ "detection_report",
794
+ "diagnostic_odds_ratio",
795
+ "diagnostic_report",
796
+ "dice",
797
+ "diebold_mariano",
798
+ "direct_assessment",
799
+ "distinct_n",
800
+ "distribution_shift_drop",
801
+ "drift_report",
802
+ "elo_ratings",
803
+ "embedding_similarity",
804
+ "energy_per_request",
805
+ "error_rate",
237
806
  "evaluate",
238
- "leaderboard",
239
- "Monitor",
240
- "Alert",
241
- "population_stability_index",
242
- "ks_drift",
243
- "Leaderboard",
807
+ "exact_match",
808
+ "execution_success_rate",
809
+ "expected_calibration_error",
244
810
  "explained_variance",
811
+ "exposure",
812
+ "extra_content_rate",
813
+ "extract_answer",
814
+ "extract_json",
245
815
  "f1",
816
+ "failure_attribution",
817
+ "fairness_report",
818
+ "faithfulness",
246
819
  "fbeta",
820
+ "fisher_exact_test",
821
+ "fleiss_kappa",
822
+ "forecast_report",
823
+ "format_compliance",
824
+ "format_multiple_choice",
825
+ "friedman_test",
826
+ "from_coco",
827
+ "groundedness",
828
+ "hallucination_rate",
247
829
  "hamming_loss",
830
+ "harmful_response_rate",
831
+ "hausdorff_distance",
832
+ "hedges_g",
833
+ "hit_rate_at_k",
834
+ "hosmer_lemeshow",
835
+ "html_report",
248
836
  "huber_loss",
837
+ "human_intervention_rate",
838
+ "icc",
839
+ "inference_cost",
840
+ "instruction_compliance_rate",
841
+ "instruction_retention",
842
+ "integrated_brier_score",
843
+ "interval_coverage",
844
+ "interval_score",
845
+ "invalid_tool_call_rate",
846
+ "invariance_violation_rate",
847
+ "iou",
249
848
  "jaccard",
849
+ "json_schema_compliance",
850
+ "json_validity",
851
+ "judge_agreement",
852
+ "judge_report",
853
+ "kaplan_meier",
854
+ "knowledge_consistency",
855
+ "krippendorff_alpha",
856
+ "kruskal_wallis_test",
857
+ "ks_drift",
858
+ "language_consistency",
859
+ "language_id_accuracy",
860
+ "language_parity",
861
+ "latency_percentiles",
862
+ "latency_summary",
863
+ "leaderboard",
864
+ "lins_ccc",
250
865
  "list_metrics",
866
+ "llmsys",
867
+ "load_benchmark",
251
868
  "log_loss",
869
+ "lost_in_the_middle",
870
+ "lr_negative",
871
+ "lr_positive",
252
872
  "mae",
873
+ "majority_vote_accuracy",
874
+ "mann_whitney_test",
253
875
  "mape",
876
+ "mase",
877
+ "mauve",
254
878
  "max_error",
879
+ "maximum_calibration_error",
255
880
  "mcc",
881
+ "mcnemar_test",
882
+ "mean_average_precision",
883
+ "mean_average_precision_at_k",
256
884
  "mean_bias_error",
885
+ "mean_pixel_accuracy",
257
886
  "median_absolute_error",
887
+ "meteor",
258
888
  "metric_info",
889
+ "miou",
890
+ "model_score",
891
+ "moverscore",
892
+ "mrr",
259
893
  "mse",
894
+ "msis",
260
895
  "msle",
896
+ "multilabel_report",
897
+ "ndcg_at_k",
898
+ "needle_in_haystack",
899
+ "net_benefit",
900
+ "noise_robustness",
901
+ "normalize_answer",
261
902
  "npv",
903
+ "ood_accuracy",
904
+ "over_refusal_rate",
905
+ "paired_bootstrap_test",
906
+ "paired_t_test",
907
+ "paraphrase_consistency",
908
+ "pass_at_k",
909
+ "patch_acceptance_rate",
910
+ "per_image_scores",
911
+ "perplexity",
912
+ "pii_leakage_rate",
913
+ "pinball_loss",
914
+ "pixel_accuracy",
915
+ "plan_adherence",
916
+ "plot",
917
+ "policy_violation_rate",
918
+ "population_stability_index",
919
+ "position_accuracy",
920
+ "position_consistency",
921
+ "power_auc",
922
+ "power_mean_difference",
923
+ "power_two_proportions",
924
+ "ppv",
262
925
  "pr_curve",
263
926
  "precision",
927
+ "precision_at_k",
928
+ "prompt_sensitivity",
929
+ "proportion_ci",
264
930
  "quantile_loss",
265
931
  "r2",
266
932
  "rae",
933
+ "rag_report",
934
+ "ranking_report",
935
+ "recalibrate",
267
936
  "recall",
937
+ "recall_at_k",
938
+ "recovery_success_rate",
939
+ "red_team_success_rate",
940
+ "refusal_rate",
268
941
  "regression",
942
+ "report_card",
943
+ "requests_per_second",
944
+ "required_field_accuracy",
945
+ "resolved_rate",
946
+ "resource_utilization",
947
+ "response_stability",
948
+ "retrieval_accuracy_by_length",
949
+ "risk_at_coverage",
950
+ "risk_coverage_curve",
269
951
  "rmse",
270
952
  "rmsle",
953
+ "rmsse",
271
954
  "roc_auc",
955
+ "roc_auc_ci",
272
956
  "roc_curve",
957
+ "rouge_1",
958
+ "rouge_2",
959
+ "rouge_l",
960
+ "rouge_lsum",
273
961
  "rse",
274
- "smape",
275
- "specificity",
276
- "top_k_accuracy",
277
- ]
278
- __all__ += list(_text_all)
279
- __all__ += list(_llmsys_all)
280
-
281
- from .fairness import FairnessReport, fairness_report # noqa: E402
282
- from .html_report import html_report # noqa: E402
283
- from .judging import JudgeReport, RubricReport, judge_report, rubric_report # noqa: E402
284
- from .llm_benchmarks import BENCHMARKS, format_multiple_choice, load_benchmark # noqa: E402
285
- from .rag_report import RAGReport, rag_report # noqa: E402
286
- from .stats.planning import ( # noqa: E402
287
- SampleSize,
288
- power_auc,
289
- power_mean_difference,
290
- power_two_proportions,
291
- sample_size_auc,
292
- sample_size_mean_difference,
293
- sample_size_proportion,
294
- sample_size_two_proportions,
295
- )
296
- from .survival import ( # noqa: E402
297
- brier_score_survival,
298
- concordance_index,
299
- integrated_brier_score,
300
- kaplan_meier,
301
- time_dependent_auc,
302
- )
303
-
304
- __all__ += [
305
- "BENCHMARKS",
306
- "FairnessReport",
307
- "JudgeReport",
308
- "RAGReport",
309
- "RubricReport",
310
- "SampleSize",
311
- "brier_score_survival",
312
- "concordance_index",
313
- "fairness_report",
314
- "format_multiple_choice",
315
- "html_report",
316
- "integrated_brier_score",
317
- "judge_report",
318
- "kaplan_meier",
319
- "load_benchmark",
320
- "power_auc",
321
- "power_mean_difference",
322
- "power_two_proportions",
323
- "rag_report",
324
962
  "rubric_report",
963
+ "rubric_score",
964
+ "runtime_efficiency",
325
965
  "sample_size_auc",
326
966
  "sample_size_mean_difference",
327
967
  "sample_size_proportion",
328
968
  "sample_size_two_proportions",
969
+ "security_vulnerability_rate",
970
+ "segmentation_confusion",
971
+ "segmentation_report",
972
+ "selective_risk",
973
+ "self_bleu",
974
+ "self_preference_bias",
975
+ "sensitivity",
976
+ "sentence_bleu",
977
+ "shapiro_wilk_test",
978
+ "smape",
979
+ "specificity",
980
+ "spice",
981
+ "state_tracking_accuracy",
982
+ "static_analysis_violation_rate",
983
+ "stats",
984
+ "steps_per_task",
985
+ "stereotype_preference",
986
+ "summary_coverage",
987
+ "syntax_validity_rate",
988
+ "t_test",
989
+ "task_completion_rate",
990
+ "task_success_rate",
991
+ "ter",
992
+ "text",
993
+ "text_report",
994
+ "throughput",
329
995
  "time_dependent_auc",
996
+ "time_per_output_token",
997
+ "time_to_first_token",
998
+ "token_f1",
999
+ "token_usage",
1000
+ "tool_argument_accuracy",
1001
+ "tool_call_f1",
1002
+ "tool_failure_recovery_rate",
1003
+ "tool_selection_accuracy",
1004
+ "tool_use_efficiency",
1005
+ "top_k_accuracy",
1006
+ "toxicity_score",
1007
+ "truncation_sensitivity",
1008
+ "unit_test_pass_rate",
1009
+ "unnecessary_tool_call_rate",
1010
+ "upgrade",
1011
+ "validate_json_schema",
1012
+ "verbosity_bias",
1013
+ "vision",
1014
+ "weat_effect_size",
1015
+ "wilcoxon_test",
1016
+ "win_rate",
1017
+ "xml_validity",
1018
+ "youden_j",
330
1019
  ]
331
1020
 
332
- import contextlib as _contextlib # noqa: E402
333
1021
 
334
- from ._update import UpdateInfo, check_for_update, upgrade # noqa: E402
1022
+ def __getattr__(name: str) -> Any:
1023
+ if name in _SUBMODULES:
1024
+ value = _importlib.import_module(f".{name}", __name__)
1025
+ elif name in _LAZY:
1026
+ value = getattr(_importlib.import_module(_LAZY[name], __name__), name)
1027
+ else:
1028
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
1029
+ globals()[name] = value # cache: later look-ups are plain attribute access
1030
+ return value
1031
+
1032
+
1033
+ def __dir__() -> list[str]:
1034
+ return sorted(set(globals()) | set(__all__))
1035
+
1036
+
1037
+ class _Package(_types.ModuleType):
1038
+ """Keeps functions that share a name with their module (``rag_report``, ``html_report``) from being replaced
1039
+ by the submodule when Python binds a freshly imported submodule to the package."""
1040
+
1041
+ def __setattr__(self, name: str, value: Any) -> None:
1042
+ if name in _LAZY and isinstance(value, _types.ModuleType):
1043
+ return # the module stays reachable as sys.modules["evalsuite.<name>"]
1044
+ super().__setattr__(name, value)
1045
+
1046
+
1047
+ _sys.modules[__name__].__class__ = _Package
335
1048
 
336
- __all__ += ["UpdateInfo", "check_for_update", "upgrade"]
337
1049
 
338
1050
  # A cached, once-a-day notice; the PyPI lookup runs in a background thread (see evalsuite._update). It must
339
1051
  # never affect importing EvalSuite.