evalsuite-python 1.0.0__tar.gz → 1.1.1__tar.gz

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.
Files changed (144) hide show
  1. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/CHANGELOG.md +53 -0
  2. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/PKG-INFO +2 -2
  3. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/README.md +1 -1
  4. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/pyproject.toml +6 -0
  5. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/Cargo.lock +6 -6
  6. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/Cargo.toml +1 -1
  7. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/surface.rs +20 -21
  8. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/text.rs +105 -14
  9. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/api.py +34 -7
  10. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/version.py +1 -1
  11. evalsuite_python-1.1.1/tests/test_v111_fixes.py +31 -0
  12. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/CONTRIBUTING.md +0 -0
  13. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/LICENSE +0 -0
  14. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/LICENSE-APACHE +0 -0
  15. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/Cargo.toml +0 -0
  16. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/README.md +0 -0
  17. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/agreement.rs +0 -0
  18. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/coco.rs +0 -0
  19. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/curve.rs +0 -0
  20. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/groups.rs +0 -0
  21. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/hash.rs +0 -0
  22. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/lib.rs +0 -0
  23. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/meteor.rs +0 -0
  24. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/permutation.rs +0 -0
  25. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/qa.rs +0 -0
  26. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/ranks.rs +0 -0
  27. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/resample.rs +0 -0
  28. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/ter.rs +0 -0
  29. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-py/Cargo.toml +0 -0
  30. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/rust/evalsuite-py/src/lib.rs +0 -0
  31. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/__init__.py +0 -0
  32. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/__main__.py +0 -0
  33. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/_bench_metrics.py +0 -0
  34. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/_evalci.py +0 -0
  35. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/_lazy.py +0 -0
  36. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/_native.py +0 -0
  37. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/benchmarks.py +0 -0
  38. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/calibration.py +0 -0
  39. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/cards.py +0 -0
  40. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/classification/__init__.py +0 -0
  41. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/classification/_common.py +0 -0
  42. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/classification/metrics.py +0 -0
  43. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/cli/__init__.py +0 -0
  44. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/cli/main.py +0 -0
  45. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/clinical/__init__.py +0 -0
  46. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/clinical/metrics.py +0 -0
  47. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/clinical/report.py +0 -0
  48. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/core/__init__.py +0 -0
  49. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/core/context.py +0 -0
  50. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/core/exceptions.py +0 -0
  51. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/core/export.py +0 -0
  52. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/core/registry.py +0 -0
  53. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/core/result.py +0 -0
  54. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/core/types.py +0 -0
  55. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/core/validation.py +0 -0
  56. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/harness.py +0 -0
  57. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/integrations.py +0 -0
  58. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/__init__.py +0 -0
  59. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/_common.py +0 -0
  60. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/agents.py +0 -0
  61. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/code.py +0 -0
  62. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/efficiency.py +0 -0
  63. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/longcontext.py +0 -0
  64. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/multilingual.py +0 -0
  65. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/robustness.py +0 -0
  66. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/safety.py +0 -0
  67. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/uncertainty.py +0 -0
  68. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/monitor.py +0 -0
  69. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/plot.py +0 -0
  70. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/py.typed +0 -0
  71. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/regression/__init__.py +0 -0
  72. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/regression/metrics.py +0 -0
  73. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/reporting.py +0 -0
  74. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/__init__.py +0 -0
  75. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/_resolve.py +0 -0
  76. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/compare.py +0 -0
  77. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/effect.py +0 -0
  78. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/hypothesis.py +0 -0
  79. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/intervals.py +0 -0
  80. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/paired.py +0 -0
  81. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/results.py +0 -0
  82. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/__init__.py +0 -0
  83. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/_common.py +0 -0
  84. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/factuality.py +0 -0
  85. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/generation.py +0 -0
  86. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/judge.py +0 -0
  87. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/qa.py +0 -0
  88. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/rag.py +0 -0
  89. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/reasoning.py +0 -0
  90. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/report.py +0 -0
  91. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/retrieval.py +0 -0
  92. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/semantic.py +0 -0
  93. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/spice.py +0 -0
  94. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/text/structured.py +0 -0
  95. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/vision/__init__.py +0 -0
  96. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/vision/detection.py +0 -0
  97. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/src/evalsuite/vision/segmentation.py +0 -0
  98. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/__init__.py +0 -0
  99. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/classification/__init__.py +0 -0
  100. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/classification/test_against_sklearn.py +0 -0
  101. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/clinical/__init__.py +0 -0
  102. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/clinical/test_outputs.py +0 -0
  103. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/clinical/test_v020.py +0 -0
  104. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/conftest.py +0 -0
  105. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/integration/__init__.py +0 -0
  106. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/integration/test_qa.py +0 -0
  107. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/integration/test_readme_examples.py +0 -0
  108. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/integration/test_repo_hygiene.py +0 -0
  109. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/llmsys/__init__.py +0 -0
  110. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/llmsys/test_code_longcontext_efficiency.py +0 -0
  111. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/llmsys/test_edges.py +0 -0
  112. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/llmsys/test_fast_text.py +0 -0
  113. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/llmsys/test_hardening.py +0 -0
  114. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/llmsys/test_safety_robustness.py +0 -0
  115. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/llmsys/test_uncertainty_agents_multilingual.py +0 -0
  116. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/output/__init__.py +0 -0
  117. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/output/test_benchmarks.py +0 -0
  118. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/output/test_cli.py +0 -0
  119. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/output/test_plot.py +0 -0
  120. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/output/test_reporting.py +0 -0
  121. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/regression/__init__.py +0 -0
  122. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/regression/test_against_sklearn.py +0 -0
  123. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/stats/__init__.py +0 -0
  124. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/stats/test_branches.py +0 -0
  125. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/stats/test_compare.py +0 -0
  126. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/stats/test_fast_paths.py +0 -0
  127. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/stats/test_reference.py +0 -0
  128. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/test_cards.py +0 -0
  129. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/test_harness.py +0 -0
  130. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/test_integrations.py +0 -0
  131. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/test_monitor.py +0 -0
  132. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/test_native.py +0 -0
  133. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/text/__init__.py +0 -0
  134. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/text/test_against_references.py +0 -0
  135. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/text/test_text_edges.py +0 -0
  136. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/text/test_v040.py +0 -0
  137. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/unit/__init__.py +0 -0
  138. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/unit/test_core.py +0 -0
  139. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/unit/test_edges.py +0 -0
  140. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/vision/__init__.py +0 -0
  141. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/vision/test_detection.py +0 -0
  142. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/vision/test_edges.py +0 -0
  143. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/vision/test_outputs.py +0 -0
  144. {evalsuite_python-1.0.0 → evalsuite_python-1.1.1}/tests/vision/test_segmentation.py +0 -0
@@ -6,6 +6,59 @@ All notable changes to this project are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.1] - 2026-11-26
10
+
11
+ A hardening and speed release: every metric of the engine's JSON bridge (npm, C, R, Julia) was fuzzed with
12
+ random and malformed arguments, and the bugs found are fixed. Results of valid calls are unchanged.
13
+
14
+ ### Fixed
15
+ - `evaluate()` treated integer-valued truth with non-integer predictions (`[1., 2., 3.]` vs `[1., 2.5, 2.]`) as
16
+ classification; it is now regression. Probabilities passed as `y_pred` for a 0/1 outcome now raise a clear
17
+ error pointing to `y_prob=` instead of a confusing label error.
18
+ - `evaluate()` accepts single-column inputs of shape (n, 1) (one-column DataFrames, reshaped arrays) as vectors;
19
+ they were rejected as malformed multilabel matrices.
20
+ - Engine (npm, C, R, Julia):
21
+ - Undefined or infinite results (MCC with one class, a likelihood ratio with no false positives) came back as
22
+ `null`; they are now NaN / Infinity in JavaScript, R and Julia (the strings "NaN", "Infinity",
23
+ "-Infinity" in raw JSON).
24
+ - Very large `n_bins`, `bins`, `num_classes`, `shape` or `n_resamples` values could abort the process on an
25
+ allocation failure; they are now range-checked errors.
26
+ - Invalid option values (`average`, `strategy`, `gains`, `threshold`, `level`, `alpha`, `k`, ...) were silently
27
+ replaced by defaults; they are now errors naming the allowed values.
28
+ - Segmentation masks with non-integer labels were truncated; they are now rejected.
29
+ - Bootstrap intervals for Dice / IoU resampled pixels instead of images; they now raise an error pointing to
30
+ the Python `bootstrap_ci`.
31
+ - The C API catches internal panics and reports them as errors (built with `panic = "unwind"`), so a bug can
32
+ no longer end the R or Julia session.
33
+ - The engine's bridge is fuzzed in CI (no panics on random or malformed input for any metric).
34
+
35
+ ### Changed
36
+ - Bootstrap intervals through the engine are 2.4–6× faster (per-observation arrays parsed once into typed
37
+ columns instead of re-reading JSON for every resample).
38
+ - BLEU's tokenization cache uses less memory and no allocation per lookup.
39
+
40
+ ## [1.1.0] - 2026-11-26
41
+
42
+ ### Added
43
+ - **The engine everywhere**: npm, C, R and Julia now cover clinical metrics (sensitivity, PPV, NPV, likelihood
44
+ ratios, diagnostic odds ratio, Youden's J, net benefit), calibration (slope, intercept, ECE, MCE,
45
+ Hosmer–Lemeshow), retrieval (NDCG, MRR, MAP, precision / recall / hit rate at k) and segmentation (Dice, IoU),
46
+ in addition to the 1.0 set.
47
+ - **Confidence intervals in every language**: `ci: "analytic"` (Wilson for proportions, DeLong for ROC AUC,
48
+ bootstrap otherwise) or `ci: "bootstrap"` (seeded BCa) returns `ci_low` / `ci_high` alongside the value.
49
+ - **Leaderboard in the engine** (`leaderboard`): Wilson intervals, McNemar tests with Holm adjustment and
50
+ significance-aware ranks, available from JavaScript, C, R and Julia.
51
+ - **R package distribution**: a self-contained source package (Rust sources vendored, offline build, Windows
52
+ support) checked with `R CMD check`, attached to each release and published to the `r-package` branch for
53
+ R-universe. **Julia**: a BinaryBuilder recipe for `EvalSuite_jll`.
54
+ - **Example notebooks** (Colab): classification quickstart, clinical TRIPOD+AI, LLM leaderboard, monitoring,
55
+ vision.
56
+
57
+ ### Changed
58
+ - BLEU 1.3× and HD95 1.6× faster than the Python reference path (memoised 13a tokenization, byte-level
59
+ tokenizer, per-segment vocabularies, packed n-gram matching; row-parallel surface scan, allocation-free label
60
+ checks). Results unchanged.
61
+
9
62
  ## [1.0.0] - 2026-11-25
10
63
 
11
64
  EvalSuite 1.0: answers with uncertainty by default, and one engine in every language.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evalsuite-python
3
- Version: 1.0.0
3
+ Version: 1.1.1
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Intended Audience :: Science/Research
6
6
  Classifier: Intended Audience :: Healthcare Industry
@@ -97,7 +97,7 @@ Project-URL: Source, https://github.com/mkcs28/evalsuite-python
97
97
  EvalSuite brings classification, regression, clinical, statistical, segmentation and object-detection
98
98
  evaluation into one consistent, validated, documented framework.
99
99
 
100
- > **Status: stable (1.0.0).** **1.0** makes `evaluate()` report confidence intervals by default and test
100
+ > **Status: stable (1.1.1).** Try it in Colab: [example notebooks](notebooks/README.md). **1.0** makes `evaluate()` report confidence intervals by default and test
101
101
  > against a baseline, and adds an LLM leaderboard harness, framework integrations (scikit-learn, Hugging Face,
102
102
  > Keras, Lightning, MLflow, W&B), monitoring with drift alerts, TRIPOD+AI / model-card report cards, and the same
103
103
  > engine for JavaScript (npm, WebAssembly), C, R and Julia.
@@ -10,7 +10,7 @@
10
10
  EvalSuite brings classification, regression, clinical, statistical, segmentation and object-detection
11
11
  evaluation into one consistent, validated, documented framework.
12
12
 
13
- > **Status: stable (1.0.0).** **1.0** makes `evaluate()` report confidence intervals by default and test
13
+ > **Status: stable (1.1.1).** Try it in Colab: [example notebooks](notebooks/README.md). **1.0** makes `evaluate()` report confidence intervals by default and test
14
14
  > against a baseline, and adds an LLM leaderboard harness, framework integrations (scikit-learn, Hugging Face,
15
15
  > Keras, Lightning, MLflow, W&B), monitoring with drift alerts, TRIPOD+AI / model-card report cards, and the same
16
16
  > engine for JavaScript (npm, WebAssembly), C, R and Julia.
@@ -129,6 +129,8 @@ ignore = ["N803", "N806", "RUF022", "UP007", "UP045", "RUF001", "RUF002", "RUF00
129
129
  "src/evalsuite/*/metrics.py" = ["E501"]
130
130
  # Developer script recording parity fixtures for the Rust crate: each case's lambda runs immediately.
131
131
  "scripts/rust_fixtures.py" = ["B007", "B023", "E501", "E731", "E741", "RUF005"]
132
+ "scripts/make_notebooks.py" = ["E501", "S102"]
133
+ "notebooks/*.ipynb" = ["E501", "I001", "S311"]
132
134
 
133
135
  [tool.mypy]
134
136
  python_version = "3.10"
@@ -149,3 +151,7 @@ follow_untyped_imports = false
149
151
  testpaths = ["tests"]
150
152
  addopts = "-q --strict-markers"
151
153
  filterwarnings = ["error::RuntimeWarning"]
154
+
155
+ [tool.ruff.format]
156
+ # Generated by scripts/make_notebooks.py.
157
+ exclude = ["notebooks/*.ipynb"]
@@ -319,7 +319,7 @@ checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
319
319
 
320
320
  [[package]]
321
321
  name = "evalsuite"
322
- version = "1.0.0"
322
+ version = "1.1.1"
323
323
  dependencies = [
324
324
  "criterion",
325
325
  "evalsuite-core",
@@ -334,14 +334,14 @@ dependencies = [
334
334
 
335
335
  [[package]]
336
336
  name = "evalsuite-capi"
337
- version = "1.0.0"
337
+ version = "1.1.1"
338
338
  dependencies = [
339
339
  "evalsuite",
340
340
  ]
341
341
 
342
342
  [[package]]
343
343
  name = "evalsuite-cli"
344
- version = "1.0.0"
344
+ version = "1.1.1"
345
345
  dependencies = [
346
346
  "clap",
347
347
  "csv",
@@ -351,14 +351,14 @@ dependencies = [
351
351
 
352
352
  [[package]]
353
353
  name = "evalsuite-core"
354
- version = "1.0.0"
354
+ version = "1.1.1"
355
355
  dependencies = [
356
356
  "rayon",
357
357
  ]
358
358
 
359
359
  [[package]]
360
360
  name = "evalsuite-py"
361
- version = "1.0.0"
361
+ version = "1.1.1"
362
362
  dependencies = [
363
363
  "evalsuite-core",
364
364
  "pyo3",
@@ -367,7 +367,7 @@ dependencies = [
367
367
 
368
368
  [[package]]
369
369
  name = "evalsuite-wasm"
370
- version = "1.0.0"
370
+ version = "1.1.1"
371
371
  dependencies = [
372
372
  "evalsuite",
373
373
  "js-sys",
@@ -3,7 +3,7 @@ members = ["evalsuite-core", "evalsuite-py"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "1.0.0"
6
+ version = "1.1.1"
7
7
  edition = "2021"
8
8
  rust-version = "1.82"
9
9
  license = "MIT OR Apache-2.0"
@@ -13,29 +13,28 @@ pub fn surface_points(mask: &[bool], dims: &[usize]) -> Vec<[i64; 3]> {
13
13
  d3[3 - nd..].copy_from_slice(dims);
14
14
  let (n0, n1, n2) = (d3[0], d3[1], d3[2]);
15
15
  let strides = [n1 * n2, n2, 1];
16
- let per_slab: Vec<Vec<[i64; 3]>> = (0..n0)
16
+ // Parallel over rows (slab × row), not only slabs, so 2-D images use every core; rows are collected in
17
+ // order, so the points come out in the same (C) order as a serial scan.
18
+ let per_slab: Vec<Vec<[i64; 3]>> = (0..n0 * n1)
17
19
  .into_par_iter()
18
- .map(|i| {
20
+ .with_min_len(16)
21
+ .map(|r| {
22
+ let (i, j) = (r / n1, r % n1);
19
23
  let mut out = Vec::new();
20
- for j in 0..n1 {
21
- let row = (i * n1 + j) * n2;
22
- for k in 0..n2 {
23
- let f = row + k;
24
- if !mask[f] {
25
- continue;
26
- }
27
- let idx = [i, j, k];
28
- // Surface: on the image border along a real axis, or a face neighbour is background.
29
- let border = (3 - nd..3).any(|ax| {
30
- let p = idx[ax];
31
- p == 0
32
- || p + 1 == d3[ax]
33
- || !mask[f - strides[ax]]
34
- || !mask[f + strides[ax]]
35
- });
36
- if border {
37
- out.push([i as i64, j as i64, k as i64]);
38
- }
24
+ let row = r * n2;
25
+ for k in 0..n2 {
26
+ let f = row + k;
27
+ if !mask[f] {
28
+ continue;
29
+ }
30
+ let idx = [i, j, k];
31
+ // Surface: on the image border along a real axis, or a face neighbour is background.
32
+ let border = (3 - nd..3).any(|ax| {
33
+ let p = idx[ax];
34
+ p == 0 || p + 1 == d3[ax] || !mask[f - strides[ax]] || !mask[f + strides[ax]]
35
+ });
36
+ if border {
37
+ out.push([i as i64, j as i64, k as i64]);
39
38
  }
40
39
  }
41
40
  out
@@ -19,27 +19,118 @@ pub fn bleu_stats(hyp: &[u32], refs: &[&[u32]], order: usize) -> Vec<i64> {
19
19
  let mut out = vec![0i64; 2 + 2 * order];
20
20
  out[0] = hyp_len;
21
21
  out[1] = if refs.is_empty() { 0 } else { closest };
22
+ // Short segments (the usual case): sorted n-gram runs merged against each reference, which avoids hash
23
+ // maps and their allocations; long ones: hash counting. Counts are integers, so both give the same result.
24
+ let short = hyp.len() <= 256 && refs.iter().all(|r| r.len() <= 256);
22
25
  for n in 1..=order {
23
- // Max count of each n-gram over the references, then matches clipped by it.
24
- let mut ref_max: FxMap<&[u32], u32> = FxMap::default();
25
- for r in refs {
26
- for (g, c) in ngram_counts(r, n) {
27
- let e = ref_max.entry(g).or_insert(0);
28
- if c > *e {
29
- *e = c;
26
+ let correct = if short {
27
+ clipped_sorted(hyp, refs, n)
28
+ } else {
29
+ clipped_hashed(hyp, refs, n)
30
+ };
31
+ out[1 + n] = correct;
32
+ out[1 + order + n] = (hyp_len - n as i64 + 1).max(0);
33
+ }
34
+ out
35
+ }
36
+
37
+ /// Runs of equal n-grams in sorted order: (n-gram, count).
38
+ fn sorted_runs(seq: &[u32], n: usize) -> Vec<(&[u32], u32)> {
39
+ if n == 0 || seq.len() < n {
40
+ return Vec::new();
41
+ }
42
+ let mut w: Vec<&[u32]> = seq.windows(n).collect();
43
+ w.sort_unstable();
44
+ let mut runs: Vec<(&[u32], u32)> = Vec::with_capacity(w.len());
45
+ for g in w {
46
+ match runs.last_mut() {
47
+ Some((last, c)) if *last == g => *c += 1,
48
+ _ => runs.push((g, 1)),
49
+ }
50
+ }
51
+ runs
52
+ }
53
+
54
+ fn clipped_sorted(hyp: &[u32], refs: &[&[u32]], n: usize) -> i64 {
55
+ // n-grams packed into one integer when the ids fit (16 bits each, n ≤ 4): sorting integers is much
56
+ // cheaper than sorting slices; otherwise slices.
57
+ let fits = n <= 4
58
+ && hyp
59
+ .iter()
60
+ .chain(refs.iter().flat_map(|r| r.iter()))
61
+ .all(|&t| t < 1 << 16);
62
+ if fits {
63
+ let pack = |s: &[u32]| -> Vec<u64> {
64
+ let mut v: Vec<u64> = if s.len() < n {
65
+ Vec::new()
66
+ } else {
67
+ s.windows(n)
68
+ .map(|w| w.iter().fold(0u64, |k, &t| (k << 16) | u64::from(t)))
69
+ .collect()
70
+ };
71
+ v.sort_unstable();
72
+ v
73
+ };
74
+ return clipped_merge(&runs_of(&pack(hyp)), refs.iter().map(|r| runs_of(&pack(r))));
75
+ }
76
+ let h = sorted_runs(hyp, n);
77
+ clipped_merge(&h, refs.iter().map(|r| sorted_runs(r, n)))
78
+ }
79
+
80
+ fn runs_of(sorted: &[u64]) -> Vec<(u64, u32)> {
81
+ let mut runs: Vec<(u64, u32)> = Vec::with_capacity(sorted.len());
82
+ for &g in sorted {
83
+ match runs.last_mut() {
84
+ Some((last, c)) if *last == g => *c += 1,
85
+ _ => runs.push((g, 1)),
86
+ }
87
+ }
88
+ runs
89
+ }
90
+
91
+ fn clipped_merge<K: Ord>(h: &[(K, u32)], refs: impl Iterator<Item = Vec<(K, u32)>>) -> i64 {
92
+ if h.is_empty() {
93
+ return 0;
94
+ }
95
+ let mut max_ref = vec![0u32; h.len()];
96
+ for rr in refs {
97
+ let (mut i, mut j) = (0, 0);
98
+ while i < h.len() && j < rr.len() {
99
+ match h[i].0.cmp(&rr[j].0) {
100
+ std::cmp::Ordering::Less => i += 1,
101
+ std::cmp::Ordering::Greater => j += 1,
102
+ std::cmp::Ordering::Equal => {
103
+ max_ref[i] = max_ref[i].max(rr[j].1);
104
+ i += 1;
105
+ j += 1;
30
106
  }
31
107
  }
32
108
  }
33
- let mut correct = 0i64;
34
- for (g, c) in ngram_counts(hyp, n) {
35
- if let Some(&m) = ref_max.get(g) {
36
- correct += i64::from(c.min(m));
109
+ }
110
+ h.iter()
111
+ .zip(&max_ref)
112
+ .map(|((_, c), m)| i64::from((*c).min(*m)))
113
+ .sum()
114
+ }
115
+
116
+ fn clipped_hashed(hyp: &[u32], refs: &[&[u32]], n: usize) -> i64 {
117
+ // Max count of each n-gram over the references, then matches clipped by it.
118
+ let mut ref_max: FxMap<&[u32], u32> = FxMap::default();
119
+ for r in refs {
120
+ for (g, c) in ngram_counts(r, n) {
121
+ let e = ref_max.entry(g).or_insert(0);
122
+ if c > *e {
123
+ *e = c;
37
124
  }
38
125
  }
39
- out[1 + n] = correct;
40
- out[1 + order + n] = (hyp_len - n as i64 + 1).max(0);
41
126
  }
42
- out
127
+ let mut correct = 0i64;
128
+ for (g, c) in ngram_counts(hyp, n) {
129
+ if let Some(&m) = ref_max.get(g) {
130
+ correct += i64::from(c.min(m));
131
+ }
132
+ }
133
+ correct
43
134
  }
44
135
 
45
136
  /// Clipped n-gram overlap between a reference `t` and a prediction `p` (ROUGE-N numerator).
@@ -116,14 +116,37 @@ _DEFAULT_REGRESSION = [
116
116
  _NO_WEIGHTS = {"max_error"}
117
117
 
118
118
 
119
- def _infer_task(y_true: ArrayLike, y_prob: Optional[ArrayLike]) -> str:
119
+ def _column(v: Any) -> Any:
120
+ """``v`` as a 1-D array when it is a single column of shape (n, 1); otherwise unchanged."""
121
+ if v is None or (isinstance(v, (list, tuple)) and not (v and isinstance(v[0], (list, tuple)))):
122
+ return v
123
+ shape = getattr(v, "shape", None)
124
+ if shape is None:
125
+ shape = np.shape(v)
126
+ if len(shape) == 2 and shape[1] == 1:
127
+ return np.asarray(v).reshape(-1)
128
+ return v
129
+
130
+
131
+ def _infer_task(y_true: ArrayLike, y_prob: Optional[ArrayLike], y_pred: Optional[ArrayLike] = None) -> str:
120
132
  if y_prob is not None:
121
133
  return "classification"
122
- return (
123
- "regression"
124
- if target_type(to_numpy(y_true, "y_true", allow_2d=True)) == "continuous"
125
- else "classification"
126
- )
134
+ yt = to_numpy(y_true, "y_true", allow_2d=True)
135
+ if target_type(yt) == "continuous":
136
+ return "regression"
137
+ if y_pred is not None and yt.dtype.kind in "iuf":
138
+ yp = to_numpy(y_pred, "y_pred", allow_2d=True)
139
+ if yp.dtype.kind == "f" and target_type(yp) == "continuous":
140
+ # Integer-valued truth with non-integer predictions: regression, unless the predictions look like
141
+ # probabilities of a 0/1 outcome, which belong in y_prob.
142
+ finite = yp[np.isfinite(yp)]
143
+ if set(np.unique(yt).tolist()) <= {0, 1} and finite.size and finite.min() >= 0 and finite.max() <= 1:
144
+ raise InputValidationError(
145
+ "y_pred holds values between 0 and 1 for a 0/1 outcome; pass probabilities as y_prob=..., "
146
+ "or set task='regression'."
147
+ )
148
+ return "regression"
149
+ return "classification"
127
150
 
128
151
 
129
152
  def evaluate(
@@ -176,7 +199,11 @@ def evaluate(
176
199
  "y_true has 3 or more dimensions, which looks like segmentation masks (images first); use "
177
200
  "evalsuite.segmentation_report(y_true, y_pred) or evalsuite.dice / evalsuite.iou."
178
201
  )
179
- task = task or _infer_task(y_true, y_prob)
202
+ # A single column (n, 1), e.g. a one-column DataFrame or a reshaped array, is a plain vector.
203
+ y_true, y_pred, y_prob, baseline_pred, baseline_prob = (
204
+ _column(v) for v in (y_true, y_pred, y_prob, baseline_pred, baseline_prob)
205
+ )
206
+ task = task or _infer_task(y_true, y_prob, y_pred)
180
207
  if task == "classification":
181
208
  result = _evaluate_classification(
182
209
  y_true, y_pred, y_prob, metrics, average, labels, pos_label, sample_weight, zero_division
@@ -1,3 +1,3 @@
1
1
  """Package version (single source of truth, read by the build backend)."""
2
2
 
3
- __version__ = "1.0.0"
3
+ __version__ = "1.1.1"
@@ -0,0 +1,31 @@
1
+ """Regression tests for bugs fixed in 1.1.1."""
2
+
3
+ import numpy as np
4
+ import pandas as pd
5
+ import pytest
6
+
7
+ import evalsuite as es
8
+ from evalsuite.core.exceptions import InputValidationError
9
+
10
+
11
+ def test_integer_truth_with_continuous_predictions_is_regression():
12
+ r = es.evaluate([1.0, 2.0, 3.0], [1.0, 2.5, 2.0])
13
+ assert r.task == "regression"
14
+ assert r["mae"].value == pytest.approx(0.5)
15
+ # integer predictions keep the classification reading
16
+ assert es.evaluate([1, 2, 3], [1, 2, 2]).task == "classification"
17
+
18
+
19
+ def test_probabilities_passed_as_predictions_get_a_clear_error():
20
+ with pytest.raises(InputValidationError, match="y_prob"):
21
+ es.evaluate([0, 1, 1], [0.2, 0.9, 0.4])
22
+ assert es.evaluate([0, 1, 1], [0.2, 0.9, 0.4], task="regression").task == "regression"
23
+
24
+
25
+ def test_single_column_inputs_are_vectors():
26
+ col = np.array([[0], [1], [1]])
27
+ assert es.evaluate(col, np.array([[0], [1], [0]]))["accuracy"].value == pytest.approx(2 / 3)
28
+ assert es.evaluate(pd.DataFrame({"y": [0, 1, 1]}), [0, 1, 0])["accuracy"].value == pytest.approx(2 / 3)
29
+ assert es.evaluate([[0], [1]], [[0], [1]])["accuracy"].value == 1.0
30
+ # real multilabel matrices are untouched
31
+ assert es.evaluate(np.array([[1, 0], [0, 1]]), np.array([[1, 0], [1, 1]])).target_type == "multilabel"