evalsuite-python 2.0.0__py3-none-any.whl → 2.1.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
@@ -45,6 +45,7 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
45
45
  AutoReport,
46
46
  auto_report,
47
47
  detect_columns,
48
+ detect_models,
48
49
  )
49
50
  from .bayes import (
50
51
  BayesComparison,
@@ -107,7 +108,9 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
107
108
  youden_j,
108
109
  )
109
110
  from .comparisons import (
111
+ ClusteredComparison,
110
112
  NemenyiResult,
113
+ clustered_comparison,
111
114
  equivalence_test,
112
115
  ipw_metric,
113
116
  nemenyi_test,
@@ -116,9 +119,13 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
116
119
  from .conformal import (
117
120
  ConformalIntervals,
118
121
  ConformalSets,
122
+ RiskControl,
123
+ adaptive_conformal,
119
124
  conformal_classification,
125
+ conformal_multilabel,
120
126
  conformal_quantile,
121
127
  conformal_regression,
128
+ conformal_risk_control,
122
129
  )
123
130
  from .core.exceptions import (
124
131
  EvalSuiteDeprecationWarning,
@@ -132,6 +139,7 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
132
139
  )
133
140
  from .core.registry import (
134
141
  MetricInfo,
142
+ explain,
135
143
  list_metrics,
136
144
  metric_info,
137
145
  )
@@ -140,11 +148,18 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
140
148
  MetricResult,
141
149
  )
142
150
  from .data_quality import (
151
+ AnnotatorReport,
152
+ DataIssues,
143
153
  DatasetCard,
154
+ LabelIssueRows,
144
155
  LabelIssues,
145
156
  LeakageReport,
157
+ annotator_report,
158
+ data_issues,
146
159
  dataset_card,
147
160
  label_issues,
161
+ label_issues_multilabel,
162
+ label_issues_regression,
148
163
  leakage_report,
149
164
  )
150
165
  from .dataframe import (
@@ -176,6 +191,7 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
176
191
  )
177
192
  from .html_report import (
178
193
  html_report,
194
+ make_interactive,
179
195
  )
180
196
  from .judging import (
181
197
  JudgeReport,
@@ -209,7 +225,10 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
209
225
  from .multilabel import (
210
226
  MultilabelReport,
211
227
  RankingReport,
228
+ coverage_error,
229
+ label_ranking_average_precision,
212
230
  multilabel_report,
231
+ ranking_loss,
213
232
  ranking_report,
214
233
  )
215
234
  from .rag_report import (
@@ -249,6 +268,11 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
249
268
  ClassificationReport,
250
269
  classification_report,
251
270
  )
271
+ from .slices import (
272
+ SliceReport,
273
+ find_failing_slices,
274
+ per_example_loss,
275
+ )
252
276
  from .stats import (
253
277
  ComparisonResult,
254
278
  ConfidenceInterval,
@@ -284,18 +308,35 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
284
308
  sample_size_auc,
285
309
  sample_size_mean_difference,
286
310
  sample_size_proportion,
311
+ sample_size_sensitivity_specificity,
287
312
  sample_size_two_proportions,
288
313
  )
314
+ from .streaming import (
315
+ StreamingClassification,
316
+ StreamingRegression,
317
+ StreamingResult,
318
+ stream_evaluate,
319
+ )
289
320
  from .survival import (
321
+ SurvivalCalibration,
290
322
  brier_score_survival,
291
323
  concordance_index,
292
324
  integrated_brier_score,
293
325
  kaplan_meier,
326
+ survival_calibration,
294
327
  time_dependent_auc,
295
328
  )
329
+ from .testing import (
330
+ MetricAssertionError,
331
+ assert_metric,
332
+ assert_no_regression,
333
+ )
296
334
  from .text import *
297
335
  from .vision import (
336
+ COCO_KEYPOINT_SIGMAS,
298
337
  DetectionReport,
338
+ KeypointReport,
339
+ PanopticReport,
299
340
  SegmentationReport,
300
341
  average_precision_detection,
301
342
  average_surface_distance,
@@ -307,9 +348,12 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
307
348
  from_coco,
308
349
  hausdorff_distance,
309
350
  iou,
351
+ keypoint_ap,
352
+ keypoint_oks,
310
353
  mean_average_precision,
311
354
  mean_pixel_accuracy,
312
355
  miou,
356
+ panoptic_quality,
313
357
  per_image_scores,
314
358
  pixel_accuracy,
315
359
  segmentation_confusion,
@@ -317,6 +361,8 @@ if TYPE_CHECKING: # static analysers and IDEs see the full eager API
317
361
  )
318
362
  from .workflow import (
319
363
  check_regression,
364
+ history_diff,
365
+ history_html,
320
366
  load_history,
321
367
  log_to_mlflow,
322
368
  log_to_wandb,
@@ -401,9 +447,10 @@ _EXPORTS: dict[str, tuple[str, ...]] = {
401
447
  "UnsupportedTaskError",
402
448
  ),
403
449
  ".core.registry": (
404
- "MetricInfo",
450
+ "explain",
405
451
  "list_metrics",
406
452
  "metric_info",
453
+ "MetricInfo",
407
454
  ),
408
455
  ".core.result": (
409
456
  "EvaluationResult",
@@ -439,10 +486,13 @@ _EXPORTS: dict[str, tuple[str, ...]] = {
439
486
  "rmsse",
440
487
  ),
441
488
  ".multilabel": (
442
- "MultilabelReport",
443
- "RankingReport",
489
+ "coverage_error",
490
+ "label_ranking_average_precision",
444
491
  "multilabel_report",
492
+ "MultilabelReport",
493
+ "ranking_loss",
445
494
  "ranking_report",
495
+ "RankingReport",
446
496
  ),
447
497
  ".recalibration": (
448
498
  "Calibrator",
@@ -455,31 +505,45 @@ _EXPORTS: dict[str, tuple[str, ...]] = {
455
505
  "clear_cache",
456
506
  ),
457
507
  ".auto_report": (
458
- "AutoReport",
459
508
  "auto_report",
509
+ "AutoReport",
460
510
  "detect_columns",
511
+ "detect_models",
461
512
  ),
462
513
  ".comparisons": (
463
- "NemenyiResult",
514
+ "clustered_comparison",
515
+ "ClusteredComparison",
464
516
  "equivalence_test",
465
517
  "ipw_metric",
466
518
  "nemenyi_test",
519
+ "NemenyiResult",
467
520
  "noninferiority_test",
468
521
  ),
469
522
  ".conformal": (
470
- "ConformalIntervals",
471
- "ConformalSets",
523
+ "adaptive_conformal",
472
524
  "conformal_classification",
525
+ "conformal_multilabel",
473
526
  "conformal_quantile",
474
527
  "conformal_regression",
528
+ "conformal_risk_control",
529
+ "ConformalIntervals",
530
+ "ConformalSets",
531
+ "RiskControl",
475
532
  ),
476
533
  ".data_quality": (
477
- "DatasetCard",
478
- "LabelIssues",
479
- "LeakageReport",
534
+ "annotator_report",
535
+ "AnnotatorReport",
536
+ "data_issues",
537
+ "DataIssues",
480
538
  "dataset_card",
539
+ "DatasetCard",
481
540
  "label_issues",
541
+ "label_issues_multilabel",
542
+ "label_issues_regression",
543
+ "LabelIssueRows",
544
+ "LabelIssues",
482
545
  "leakage_report",
546
+ "LeakageReport",
483
547
  ),
484
548
  ".reclassification": (
485
549
  "ExternalValidation",
@@ -501,6 +565,8 @@ _EXPORTS: dict[str, tuple[str, ...]] = {
501
565
  ".dataframe": ("register_accessors",),
502
566
  ".workflow": (
503
567
  "check_regression",
568
+ "history_diff",
569
+ "history_html",
504
570
  "load_history",
505
571
  "log_to_mlflow",
506
572
  "log_to_wandb",
@@ -508,6 +574,22 @@ _EXPORTS: dict[str, tuple[str, ...]] = {
508
574
  "record_history",
509
575
  "serve",
510
576
  ),
577
+ ".slices": (
578
+ "find_failing_slices",
579
+ "per_example_loss",
580
+ "SliceReport",
581
+ ),
582
+ ".testing": (
583
+ "assert_metric",
584
+ "assert_no_regression",
585
+ "MetricAssertionError",
586
+ ),
587
+ ".streaming": (
588
+ "stream_evaluate",
589
+ "StreamingClassification",
590
+ "StreamingRegression",
591
+ "StreamingResult",
592
+ ),
511
593
  ".fairness": (
512
594
  "FairnessReport",
513
595
  "fairness_report",
@@ -516,7 +598,10 @@ _EXPORTS: dict[str, tuple[str, ...]] = {
516
598
  "Leaderboard",
517
599
  "leaderboard",
518
600
  ),
519
- ".html_report": ("html_report",),
601
+ ".html_report": (
602
+ "html_report",
603
+ "make_interactive",
604
+ ),
520
605
  ".judging": (
521
606
  "JudgeReport",
522
607
  "RubricReport",
@@ -673,20 +758,23 @@ _EXPORTS: dict[str, tuple[str, ...]] = {
673
758
  "wilcoxon_test",
674
759
  ),
675
760
  ".stats.planning": (
676
- "SampleSize",
677
761
  "power_auc",
678
762
  "power_mean_difference",
679
763
  "power_two_proportions",
680
764
  "sample_size_auc",
681
765
  "sample_size_mean_difference",
682
766
  "sample_size_proportion",
767
+ "sample_size_sensitivity_specificity",
683
768
  "sample_size_two_proportions",
769
+ "SampleSize",
684
770
  ),
685
771
  ".survival": (
686
772
  "brier_score_survival",
687
773
  "concordance_index",
688
774
  "integrated_brier_score",
689
775
  "kaplan_meier",
776
+ "survival_calibration",
777
+ "SurvivalCalibration",
690
778
  "time_dependent_auc",
691
779
  ),
692
780
  ".text": (
@@ -768,25 +856,31 @@ _EXPORTS: dict[str, tuple[str, ...]] = {
768
856
  "xml_validity",
769
857
  ),
770
858
  ".vision": (
771
- "DetectionReport",
772
- "SegmentationReport",
773
859
  "average_precision_detection",
774
860
  "average_surface_distance",
775
861
  "boundary_iou",
776
862
  "box_iou",
863
+ "COCO_KEYPOINT_SIGMAS",
777
864
  "detection_pr_curve",
778
865
  "detection_report",
866
+ "DetectionReport",
779
867
  "dice",
780
868
  "from_coco",
781
869
  "hausdorff_distance",
782
870
  "iou",
871
+ "keypoint_ap",
872
+ "keypoint_oks",
873
+ "KeypointReport",
783
874
  "mean_average_precision",
784
875
  "mean_pixel_accuracy",
785
876
  "miou",
877
+ "panoptic_quality",
878
+ "PanopticReport",
786
879
  "per_image_scores",
787
880
  "pixel_accuracy",
788
881
  "segmentation_confusion",
789
882
  "segmentation_report",
883
+ "SegmentationReport",
790
884
  ),
791
885
  }
792
886
 
@@ -794,17 +888,19 @@ _LAZY: dict[str, str] = {name: mod for mod, names in _EXPORTS.items() for name i
794
888
  _LAZY.update({"UpdateInfo": "._update", "check_for_update": "._update", "upgrade": "._update"})
795
889
 
796
890
  __all__ = [
797
- "EvalSuiteDeprecationWarning",
798
891
  "AgentReport",
799
892
  "Alert",
893
+ "AnnotatorReport",
800
894
  "AutoReport",
801
895
  "BENCHMARKS",
802
896
  "BayesComparison",
803
897
  "BlandAltman",
898
+ "COCO_KEYPOINT_SIGMAS",
804
899
  "CacheInfo",
805
900
  "CalibrationReport",
806
901
  "Calibrator",
807
902
  "ClassificationReport",
903
+ "ClusteredComparison",
808
904
  "ComparisonResult",
809
905
  "ConfidenceInterval",
810
906
  "ConformalIntervals",
@@ -812,11 +908,13 @@ __all__ = [
812
908
  "ContaminationReport",
813
909
  "ConversationReport",
814
910
  "CostQualityReport",
911
+ "DataIssues",
815
912
  "DatasetCard",
816
913
  "DecisionCurve",
817
914
  "DetectionReport",
818
915
  "DiagnosticReport",
819
916
  "DriftReport",
917
+ "EvalSuiteDeprecationWarning",
820
918
  "EvalSuiteError",
821
919
  "EvaluationResult",
822
920
  "ExternalValidation",
@@ -826,9 +924,12 @@ __all__ = [
826
924
  "ICCResult",
827
925
  "InputValidationError",
828
926
  "JudgeReport",
927
+ "KeypointReport",
928
+ "LabelIssueRows",
829
929
  "LabelIssues",
830
930
  "Leaderboard",
831
931
  "LeakageReport",
932
+ "MetricAssertionError",
832
933
  "MetricInfo",
833
934
  "MetricInputError",
834
935
  "MetricResult",
@@ -838,14 +939,21 @@ __all__ = [
838
939
  "OptionalDependencyError",
839
940
  "PII_PATTERNS",
840
941
  "PYTHON_KEYWORDS",
942
+ "PanopticReport",
841
943
  "RAGReport",
842
944
  "RankingReport",
843
945
  "ReclassificationResult",
844
946
  "ReportCard",
947
+ "RiskControl",
845
948
  "RubricReport",
846
949
  "SampleSize",
847
950
  "SegmentationReport",
951
+ "SliceReport",
848
952
  "StatisticalTestError",
953
+ "StreamingClassification",
954
+ "StreamingRegression",
955
+ "StreamingResult",
956
+ "SurvivalCalibration",
849
957
  "TestResult",
850
958
  "TextReport",
851
959
  "UndefinedMetricWarning",
@@ -856,15 +964,19 @@ __all__ = [
856
964
  "accuracy",
857
965
  "accuracy_ci",
858
966
  "adaptive_calibration_error",
967
+ "adaptive_conformal",
859
968
  "add_typos",
860
969
  "adjust_pvalues",
861
970
  "adjusted_r2",
862
971
  "adversarial_robustness",
863
972
  "agent_cost_per_task",
864
973
  "agent_report",
974
+ "annotator_report",
865
975
  "answer_correctness",
866
976
  "answer_relevance",
867
977
  "api_call_success_rate",
978
+ "assert_metric",
979
+ "assert_no_regression",
868
980
  "attack_success_rate",
869
981
  "aurc",
870
982
  "auto_report",
@@ -907,6 +1019,7 @@ __all__ = [
907
1019
  "clear_cache",
908
1020
  "cliffs_delta",
909
1021
  "clinical",
1022
+ "clustered_comparison",
910
1023
  "code_complexity",
911
1024
  "code_switching_robustness",
912
1025
  "codebleu",
@@ -917,8 +1030,10 @@ __all__ = [
917
1030
  "concordance_index",
918
1031
  "confidence_accuracy_correlation",
919
1032
  "conformal_classification",
1033
+ "conformal_multilabel",
920
1034
  "conformal_quantile",
921
1035
  "conformal_regression",
1036
+ "conformal_risk_control",
922
1037
  "confusion_matrix",
923
1038
  "constraint_satisfaction_rate",
924
1039
  "contamination_check",
@@ -930,6 +1045,7 @@ __all__ = [
930
1045
  "conversation_report",
931
1046
  "cost_quality_report",
932
1047
  "coverage_at_risk",
1048
+ "coverage_error",
933
1049
  "coverage_rate",
934
1050
  "cramers_v",
935
1051
  "cross_document_consistency",
@@ -937,10 +1053,12 @@ __all__ = [
937
1053
  "cross_lingual_consistency",
938
1054
  "crps",
939
1055
  "cultural_appropriateness",
1056
+ "data_issues",
940
1057
  "dataset_card",
941
1058
  "decision_curve",
942
1059
  "delong_test",
943
1060
  "detect_columns",
1061
+ "detect_models",
944
1062
  "detect_pii",
945
1063
  "detection_pr_curve",
946
1064
  "detection_report",
@@ -961,6 +1079,7 @@ __all__ = [
961
1079
  "exact_match",
962
1080
  "execution_success_rate",
963
1081
  "expected_calibration_error",
1082
+ "explain",
964
1083
  "explained_variance",
965
1084
  "exposure",
966
1085
  "external_validation",
@@ -972,6 +1091,7 @@ __all__ = [
972
1091
  "fairness_report",
973
1092
  "faithfulness",
974
1093
  "fbeta",
1094
+ "find_failing_slices",
975
1095
  "fisher_exact_test",
976
1096
  "fleiss_kappa",
977
1097
  "forecast_report",
@@ -985,6 +1105,8 @@ __all__ = [
985
1105
  "harmful_response_rate",
986
1106
  "hausdorff_distance",
987
1107
  "hedges_g",
1108
+ "history_diff",
1109
+ "history_html",
988
1110
  "hit_rate_at_k",
989
1111
  "hosmer_lemeshow",
990
1112
  "html_report",
@@ -1007,11 +1129,16 @@ __all__ = [
1007
1129
  "judge_agreement",
1008
1130
  "judge_report",
1009
1131
  "kaplan_meier",
1132
+ "keypoint_ap",
1133
+ "keypoint_oks",
1010
1134
  "knowledge_consistency",
1011
1135
  "krippendorff_alpha",
1012
1136
  "kruskal_wallis_test",
1013
1137
  "ks_drift",
1014
1138
  "label_issues",
1139
+ "label_issues_multilabel",
1140
+ "label_issues_regression",
1141
+ "label_ranking_average_precision",
1015
1142
  "language_consistency",
1016
1143
  "language_id_accuracy",
1017
1144
  "language_parity",
@@ -1032,6 +1159,7 @@ __all__ = [
1032
1159
  "lr_positive",
1033
1160
  "mae",
1034
1161
  "majority_vote_accuracy",
1162
+ "make_interactive",
1035
1163
  "mann_whitney_test",
1036
1164
  "mape",
1037
1165
  "mase",
@@ -1068,9 +1196,11 @@ __all__ = [
1068
1196
  "over_refusal_rate",
1069
1197
  "paired_bootstrap_test",
1070
1198
  "paired_t_test",
1199
+ "panoptic_quality",
1071
1200
  "paraphrase_consistency",
1072
1201
  "pass_at_k",
1073
1202
  "patch_acceptance_rate",
1203
+ "per_example_loss",
1074
1204
  "per_image_scores",
1075
1205
  "perplexity",
1076
1206
  "pii_leakage_rate",
@@ -1095,6 +1225,7 @@ __all__ = [
1095
1225
  "r2",
1096
1226
  "rae",
1097
1227
  "rag_report",
1228
+ "ranking_loss",
1098
1229
  "ranking_report",
1099
1230
  "recalibrate",
1100
1231
  "recall",
@@ -1133,6 +1264,7 @@ __all__ = [
1133
1264
  "sample_size_auc",
1134
1265
  "sample_size_mean_difference",
1135
1266
  "sample_size_proportion",
1267
+ "sample_size_sensitivity_specificity",
1136
1268
  "sample_size_two_proportions",
1137
1269
  "security_vulnerability_rate",
1138
1270
  "segmentation_confusion",
@@ -1152,7 +1284,9 @@ __all__ = [
1152
1284
  "stats",
1153
1285
  "steps_per_task",
1154
1286
  "stereotype_preference",
1287
+ "stream_evaluate",
1155
1288
  "summary_coverage",
1289
+ "survival_calibration",
1156
1290
  "syntax_validity_rate",
1157
1291
  "t_test",
1158
1292
  "task_completion_rate",
@@ -2094,16 +2094,34 @@ def _v13(c: _Cases, n: int, rng: np.random.Generator) -> None:
2094
2094
  if skm is not None:
2095
2095
  c.add(
2096
2096
  "multilabel.label_ranking_average_precision",
2097
- lambda: es.multilabel_report(Y, y_score=S, n_resamples=1)["label_ranking_average_precision"],
2097
+ lambda: es.label_ranking_average_precision(Y, S),
2098
2098
  "scikit-learn",
2099
2099
  lambda: skm.label_ranking_average_precision_score(Y, S),
2100
2100
  )
2101
2101
  c.add(
2102
2102
  "multilabel.coverage_error",
2103
- lambda: es.multilabel_report(Y, y_score=S, n_resamples=1)["coverage_error"],
2103
+ lambda: es.coverage_error(Y, S),
2104
2104
  "scikit-learn",
2105
2105
  lambda: skm.coverage_error(Y, S),
2106
2106
  )
2107
+ c.add(
2108
+ "multilabel.ranking_loss",
2109
+ lambda: es.ranking_loss(Y, S),
2110
+ "scikit-learn",
2111
+ lambda: skm.label_ranking_loss(Y, S),
2112
+ )
2113
+ # 2.1: streaming evaluation against scikit-learn on all the data at once
2114
+ if skm is not None:
2115
+ ys21 = rng.integers(0, 2, n)
2116
+ ps21 = np.round(rng.random(n), 3)
2117
+
2118
+ def stream() -> Any:
2119
+ acc = es.StreamingClassification()
2120
+ for part in np.array_split(np.arange(n), 4):
2121
+ acc.update(ys21[part], y_prob=ps21[part])
2122
+ return acc.result()["roc_auc"]
2123
+
2124
+ c.add("streaming.roc_auc", stream, "scikit-learn", lambda: skm.roc_auc_score(ys21, ps21))
2107
2125
  # forecasting
2108
2126
  yt, ya, yb = rng.normal(size=n), rng.normal(size=n), rng.normal(size=n)
2109
2127
  train = np.cumsum(rng.normal(size=n))
evalsuite/auto_report.py CHANGED
@@ -61,6 +61,19 @@ def detect_columns(columns: Sequence[str]) -> dict[str, Any]:
61
61
  return found
62
62
 
63
63
 
64
+ def detect_models(columns: Sequence[str]) -> dict[str, dict[str, str]]:
65
+ """Model prediction columns for a comparison: ``pred_<model>`` / ``<model>_pred`` (labels or values) and
66
+ ``prob_<model>`` / ``<model>_prob`` (probabilities). Returns ``{"pred": {model: column}, "prob": {...}}``."""
67
+ out: dict[str, dict[str, str]] = {"pred": {}, "prob": {}}
68
+ for c in (str(x) for x in columns):
69
+ for role, words in (("pred", "pred|prediction|yhat"), ("prob", "prob|proba|risk|score")):
70
+ m = re.fullmatch(rf"(?i)(?:{words})[_:\-](.+)", c) or re.fullmatch(rf"(?i)(.+?)[_:\-](?:{words})", c)
71
+ if m and m.group(1).lower() not in ("y", "true", "label", "class"):
72
+ out[role][m.group(1)] = c
73
+ break
74
+ return out
75
+
76
+
64
77
  @dataclass(frozen=True)
65
78
  class AutoReport:
66
79
  """The detected set-up, the results that went into the report, and the report's HTML."""
@@ -153,9 +166,12 @@ def auto_report(
153
166
  path: Optional[str] = None,
154
167
  title: Optional[str] = None,
155
168
  random_state: Optional[int] = 0,
169
+ interactive: bool = True,
156
170
  ) -> AutoReport:
157
171
  """Detect the columns and task (see the module docstring), evaluate, and build one HTML report. With a file
158
- path as ``data``, the report is written next to it as ``<name>.report.html`` unless ``path`` is given."""
172
+ path as ``data``, the report is written next to it as ``<name>.report.html`` unless ``path`` is given.
173
+ ``interactive`` (default) adds sortable tables, a row filter, a section menu, metric definitions on hover and
174
+ a light / dark switch (one self-contained file); ``False`` gives the plain static page."""
159
175
  import evalsuite as es
160
176
 
161
177
  df = _load(data)
@@ -197,7 +213,17 @@ def auto_report(
197
213
  yp = df[found["pred"]].to_numpy() if found["pred"] else None
198
214
  pp = None
199
215
  if prob_cols:
200
- pp = df[prob_cols[0]].to_numpy(dtype=float) if len(prob_cols) == 1 else df[prob_cols].to_numpy(dtype=float)
216
+ try:
217
+ pp = (
218
+ df[prob_cols[0]].to_numpy(dtype=float)
219
+ if len(prob_cols) == 1
220
+ else df[prob_cols].to_numpy(dtype=float)
221
+ )
222
+ except (TypeError, ValueError):
223
+ raise InputValidationError(
224
+ f"Probability column(s) {', '.join(prob_cols)} contain text that is not a number; "
225
+ "fix the values or name the columns with prob=."
226
+ ) from None
201
227
  cl = df[found["clusters"]].to_numpy() if found["clusters"] else None
202
228
  sections: dict[str, Any] = {}
203
229
  intro = (
@@ -243,6 +269,10 @@ def auto_report(
243
269
  intro=intro,
244
270
  metadata={"Outcome": t, "Task": task},
245
271
  )
272
+ if interactive:
273
+ from .html_report import make_interactive
274
+
275
+ page = make_interactive(page)
246
276
  out = path
247
277
  if out is None and isinstance(data, (str, os.PathLike)):
248
278
  out = os.path.splitext(str(data))[0] + ".report.html"
evalsuite/bayes.py CHANGED
@@ -313,20 +313,32 @@ def bayes_correlated_ttest(
313
313
  lo = hi = mean
314
314
  else:
315
315
  scale = math.sqrt((1.0 / n + rho / (1.0 - rho)) * var)
316
- post = stats.t(df=n - 1, loc=mean, scale=scale)
317
- # exact probabilities on the "A better" orientation
316
+ # Student-t posterior; cdf / sf / ppf through scipy.special exactly as scipy.stats.t computes them
317
+ # (standardise, then stdtr / stdtrit), without building a frozen distribution
318
+ from scipy.special import stdtr, stdtrit
319
+
320
+ dfree = n - 1
321
+
322
+ def cdf(x: float) -> float:
323
+ return float(stdtr(dfree, (x - mean) / scale))
324
+
325
+ def sf(x: float) -> float:
326
+ return float(stdtr(dfree, -((x - mean) / scale)))
327
+
318
328
  lo_r, hi_r = rp
319
329
  if sign > 0:
320
- pa = float(post.sf(hi_r))
321
- pb = float(post.cdf(lo_r))
330
+ pa = sf(hi_r)
331
+ pb = cdf(lo_r)
322
332
  else:
323
- pa = float(post.cdf(-hi_r))
324
- pb = float(post.sf(-lo_r))
333
+ pa = cdf(-hi_r)
334
+ pb = sf(-lo_r)
325
335
  pr = float(1.0 - pa - pb)
326
336
  a_ = (1 - level) / 2
327
- lo, hi = float(post.ppf(a_)), float(post.ppf(1 - a_))
337
+ lo = float(stdtrit(dfree, a_) * scale + mean)
338
+ hi = float(stdtrit(dfree, 1 - a_) * scale + mean)
328
339
 
329
- def _later(post: Any = post) -> Any: # only feeds ``samples`` (plots): drawn on first access, same draws
340
+ def _later() -> Any: # only feeds ``samples`` (plots): drawn on first access, same draws as before
341
+ post = stats.t(df=dfree, loc=mean, scale=scale)
330
342
  return post.rvs(size=n_samples, random_state=np.random.default_rng(random_state))
331
343
 
332
344
  draws = _later
evalsuite/benchmarks.py CHANGED
@@ -646,6 +646,7 @@ _GROUPS = (
646
646
  "multilabel.",
647
647
  "method_agreement.",
648
648
  "recalibration.",
649
+ "streaming.",
649
650
  "bayes.",
650
651
  "conformal.",
651
652
  "comparisons.",