evalsuite-python 0.5.2__tar.gz → 0.5.4__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 (113) hide show
  1. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/CHANGELOG.md +45 -0
  2. evalsuite_python-0.5.4/LICENSE-APACHE +191 -0
  3. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/PKG-INFO +49 -39
  4. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/README.md +46 -37
  5. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/pyproject.toml +2 -2
  6. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/core/context.py +18 -0
  7. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/core/validation.py +27 -6
  8. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/_common.py +45 -16
  9. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/efficiency.py +3 -4
  10. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/multilingual.py +25 -13
  11. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/regression/metrics.py +22 -5
  12. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/stats/effect.py +10 -8
  13. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/stats/hypothesis.py +216 -35
  14. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/stats/intervals.py +8 -6
  15. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/stats/paired.py +4 -4
  16. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/_common.py +4 -1
  17. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/generation.py +125 -51
  18. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/judge.py +23 -5
  19. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/semantic.py +25 -5
  20. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/version.py +1 -1
  21. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/vision/segmentation.py +33 -13
  22. evalsuite_python-0.5.4/tests/llmsys/test_fast_text.py +137 -0
  23. evalsuite_python-0.5.4/tests/stats/test_fast_paths.py +129 -0
  24. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/.gitignore +0 -0
  25. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/CONTRIBUTING.md +0 -0
  26. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/LICENSE +0 -0
  27. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/__init__.py +0 -0
  28. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/__main__.py +0 -0
  29. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/_bench_metrics.py +0 -0
  30. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/_lazy.py +0 -0
  31. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/api.py +0 -0
  32. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/benchmarks.py +0 -0
  33. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/calibration.py +0 -0
  34. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/classification/__init__.py +0 -0
  35. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/classification/_common.py +0 -0
  36. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/classification/metrics.py +0 -0
  37. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/cli/__init__.py +0 -0
  38. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/cli/main.py +0 -0
  39. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/clinical/__init__.py +0 -0
  40. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/clinical/metrics.py +0 -0
  41. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/clinical/report.py +0 -0
  42. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/core/__init__.py +0 -0
  43. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/core/exceptions.py +0 -0
  44. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/core/export.py +0 -0
  45. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/core/registry.py +0 -0
  46. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/core/result.py +0 -0
  47. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/core/types.py +0 -0
  48. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/__init__.py +0 -0
  49. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/agents.py +0 -0
  50. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/code.py +0 -0
  51. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/longcontext.py +0 -0
  52. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/robustness.py +0 -0
  53. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/safety.py +0 -0
  54. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/llmsys/uncertainty.py +0 -0
  55. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/plot.py +0 -0
  56. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/py.typed +0 -0
  57. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/regression/__init__.py +0 -0
  58. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/reporting.py +0 -0
  59. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/stats/__init__.py +0 -0
  60. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/stats/_resolve.py +0 -0
  61. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/stats/compare.py +0 -0
  62. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/stats/results.py +0 -0
  63. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/__init__.py +0 -0
  64. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/factuality.py +0 -0
  65. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/qa.py +0 -0
  66. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/rag.py +0 -0
  67. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/reasoning.py +0 -0
  68. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/report.py +0 -0
  69. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/retrieval.py +0 -0
  70. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/spice.py +0 -0
  71. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/text/structured.py +0 -0
  72. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/vision/__init__.py +0 -0
  73. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/src/evalsuite/vision/detection.py +0 -0
  74. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/__init__.py +0 -0
  75. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/classification/__init__.py +0 -0
  76. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/classification/test_against_sklearn.py +0 -0
  77. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/clinical/__init__.py +0 -0
  78. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/clinical/test_outputs.py +0 -0
  79. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/clinical/test_v020.py +0 -0
  80. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/conftest.py +0 -0
  81. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/integration/__init__.py +0 -0
  82. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/integration/test_qa.py +0 -0
  83. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/integration/test_readme_examples.py +0 -0
  84. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/integration/test_repo_hygiene.py +0 -0
  85. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/llmsys/__init__.py +0 -0
  86. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/llmsys/test_code_longcontext_efficiency.py +0 -0
  87. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/llmsys/test_edges.py +0 -0
  88. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/llmsys/test_hardening.py +0 -0
  89. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/llmsys/test_safety_robustness.py +0 -0
  90. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/llmsys/test_uncertainty_agents_multilingual.py +0 -0
  91. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/output/__init__.py +0 -0
  92. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/output/test_benchmarks.py +0 -0
  93. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/output/test_cli.py +0 -0
  94. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/output/test_plot.py +0 -0
  95. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/output/test_reporting.py +0 -0
  96. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/regression/__init__.py +0 -0
  97. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/regression/test_against_sklearn.py +0 -0
  98. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/stats/__init__.py +0 -0
  99. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/stats/test_branches.py +0 -0
  100. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/stats/test_compare.py +0 -0
  101. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/stats/test_reference.py +0 -0
  102. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/text/__init__.py +0 -0
  103. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/text/test_against_references.py +0 -0
  104. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/text/test_text_edges.py +0 -0
  105. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/text/test_v040.py +0 -0
  106. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/unit/__init__.py +0 -0
  107. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/unit/test_core.py +0 -0
  108. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/unit/test_edges.py +0 -0
  109. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/vision/__init__.py +0 -0
  110. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/vision/test_detection.py +0 -0
  111. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/vision/test_edges.py +0 -0
  112. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/vision/test_outputs.py +0 -0
  113. {evalsuite_python-0.5.2 → evalsuite_python-0.5.4}/tests/vision/test_segmentation.py +0 -0
@@ -6,6 +6,51 @@ All notable changes to this project are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.5.4] - 2026-11-09
10
+
11
+ Speed release and a second licence. No API changes; every result is unchanged (all 81 benchmark rows and
12
+ 204 per-metric comparisons agree with their reference libraries, as before).
13
+
14
+ ### Added
15
+ - Dual licence: EvalSuite is now available under **MIT OR Apache-2.0**, at your option (`LICENSE`,
16
+ `LICENSE-APACHE`). Both texts ship in the wheel and sdist; the PyPI licence expression is `MIT OR Apache-2.0`.
17
+
18
+ ### Changed
19
+ - Overall benchmark speed-up 2.06× → **3.07×** (75 of 81 rows faster, was 58); per-metric speed-up against
20
+ reference libraries 2.80× → **4.67×** (165 of 172 faster, was 138).
21
+ - Classification: integer labels are found and encoded without sorting or `searchsorted`, and binary label sets
22
+ come straight from min/max; the confusion matrix counts without unit weights (binary `evaluate()` 37× → 98×
23
+ faster than scikit-learn, 10-class macro F1 3.4× → 16.5×, diagnostic report 0.22× → 1.1×).
24
+ - Statistics: Wilcoxon, Mann–Whitney, Kruskal–Wallis and Friedman rank once with an unstable sort and bincount
25
+ rank sums (2–4× faster than SciPy, identical p-values including SciPy's exact/asymptotic switching); paired
26
+ t-test, χ² and Cramér's V, McNemar, proportion and accuracy intervals compute directly; Fisher's exact test sums
27
+ the hypergeometric pmf in log space (5–7× faster, within 1e-11 of SciPy).
28
+ - Text: TER reuses edit-distance rows across shift candidates (0.61× → 1.5× sacreBLEU); BLEU, self-BLEU and ROUGE
29
+ (0.86× → 1.9× rouge-score)
30
+ build n-grams in C and memoise tokenisation like sacreBLEU and rouge-score; chrF has a tighter matching loop;
31
+ Fleiss' kappa (0.23× → 6×), Krippendorff's alpha (0.77× → 2.0×) and language-ID accuracy (0.38× → 3–7×) are vectorised.
32
+ - MoverScore uses POT's network simplex when POT is installed and an exact assignment formulation otherwise
33
+ (0.07× → 0.9× POT).
34
+ - Hausdorff and surface distances use k-d trees on the surface points instead of whole-image distance transforms.
35
+ - Regression `evaluate()` shares squared errors between MSE, RMSE and R², and task inference checks a short leading
36
+ chunk for fractional values first (0.69× → 1.8× scikit-learn).
37
+ - Benchmarks and README tables rerun on 0.5.4.
38
+
39
+ ## [0.5.3] - 2026-11-09
40
+
41
+ Performance release; benchmarks rerun. No API changes.
42
+
43
+ ### Changed
44
+ - `t_test` computes the t statistic and its p-value directly (Student-t tail via `scipy.special.stdtr`) from
45
+ one pass over each sample instead of calling `scipy.stats.ttest_ind` and recomputing means and variances;
46
+ identical to SciPy within 1e-15 and now faster than it (was 0.43×).
47
+ - `latency_percentiles` and every LLM-systems latency/step/token summary take min, max and all percentiles
48
+ from a single `np.partition` instead of separate `np.percentile` calls (identical values, ~1.4× faster).
49
+ - Statistical tests no longer copy inputs that are already float64.
50
+ - CI: Python 3.9 tests run on ubuntu-22.04 (ubuntu-latest no longer ships 3.9); GitHub Actions updated
51
+ (checkout 7.0.1, setup-python 7.1.0, upload-artifact 7.0.2, download-artifact 8.0.2).
52
+ - README and BENCHMARKS.md: all suites and the per-metric table rerun on 0.5.3.
53
+
9
54
  ## [0.5.2] - 2026-11-07
10
55
 
11
56
  Security and performance hardening. No API changes.
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 Manoj Kumar C S and Nikhil D Bharadwaj
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: evalsuite-python
3
- Version: 0.5.2
3
+ Version: 0.5.4
4
4
  Summary: A unified Python framework for machine-learning, clinical, statistical, segmentation, object-detection, uncertainty, and model evaluation.
5
5
  Project-URL: Homepage, https://evalsuite-nine.vercel.app
6
6
  Project-URL: Documentation, https://evalsuite-nine.vercel.app/docs
@@ -9,8 +9,9 @@ Project-URL: Issues, https://github.com/mkcs28/evalsuite-python/issues
9
9
  Project-URL: Changelog, https://github.com/mkcs28/evalsuite-python/blob/main/CHANGELOG.md
10
10
  Author: Manoj Kumar C S, Nikhil D Bharadwaj
11
11
  Maintainer: Manoj Kumar C S, Nikhil D Bharadwaj
12
- License-Expression: MIT
12
+ License-Expression: MIT OR Apache-2.0
13
13
  License-File: LICENSE
14
+ License-File: LICENSE-APACHE
14
15
  Keywords: calibration,classification,clinical,diagnostic accuracy,evaluation,mAP,machine learning,metrics,object detection,regression,reproducibility,segmentation,statistical tests,statistics
15
16
  Classifier: Development Status :: 5 - Production/Stable
16
17
  Classifier: Intended Audience :: Developers
@@ -76,14 +77,14 @@ Description-Content-Type: text/markdown
76
77
  [![CI](https://github.com/mkcs28/evalsuite-python/actions/workflows/ci.yml/badge.svg)](https://github.com/mkcs28/evalsuite-python/actions/workflows/ci.yml)
77
78
  [![PyPI](https://img.shields.io/pypi/v/evalsuite-python)](https://pypi.org/project/evalsuite-python/)
78
79
  [![Python](https://img.shields.io/pypi/pyversions/evalsuite-python)](https://pypi.org/project/evalsuite-python/)
79
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
80
+ [![License: MIT OR Apache-2.0](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue.svg)](#license)
80
81
 
81
82
  **Unified, reproducible evaluation for machine learning, LLM and research.**
82
83
 
83
84
  EvalSuite brings classification, regression, clinical, statistical, segmentation and object-detection
84
85
  evaluation into one consistent, validated, documented framework.
85
86
 
86
- > **Status: stable (0.5.2).** Every item on the 0.1.0–0.5.0 roadmaps is implemented and verified, including SPICE.
87
+ > **Status: stable (0.5.4).** Every item on the 0.1.0–0.5.0 roadmaps is implemented and verified, including SPICE.
87
88
  > **LLM systems arrive in 0.5.0**: safety, robustness, calibration and uncertainty, agents and tool use,
88
89
  > multilingual, code generation, long context and summarization, and inference efficiency and cost.
89
90
 
@@ -339,52 +340,55 @@ Input files can be CSV, TSV, Parquet or JSON. Output format follows `--format` o
339
340
 
340
341
  ## Performance
341
342
 
342
- Benchmarked against reference implementations on the same data (fastest of 5 runs; EvalSuite 0.5.1, Python 3.13,
343
+ Benchmarked against reference implementations on the same data (fastest of 5 runs; EvalSuite 0.5.4, Python 3.13,
343
344
  NumPy 2.5, Linux x86_64). **Overall: 81 of 81 rows agree with the reference** (largest
344
- difference 2.5e-14), 56 are faster, and the geometric-mean speed-up across all
345
- 27 cases and three sizes is **1.89×**. At 1,000,000 samples (pixels for
345
+ difference 2.5e-14), 75 are faster, and the geometric-mean speed-up across all
346
+ 27 cases and three sizes is **3.07×**. At 1,000,000 samples (pixels for
346
347
  segmentation; 1,000 images for detection and 50 for Hausdorff; 10,000 examples for the LLM cases), in
347
348
  alphabetical order:
348
349
 
349
350
  | Case | Reference | EvalSuite (ms) | Reference (ms) | Speed-up |
350
351
  | --- | --- | ---: | ---: | ---: |
351
- | 10 classes: macro F1 | scikit-learn | 41.5 | 137.6 | **3.3×** |
352
- | agreement: Krippendorff's alpha, interval (4 raters × 10000 items) | krippendorff | 4.5 | 4.5 | **1.0×** |
353
- | binary: 8 label metrics via evaluate() | scikit-learn | 49.4 | 1056.8 | **21.4×** |
354
- | binary: ROC AUC | scikit-learn | 200.3 | 338.5 | **1.7×** |
355
- | calibration: slope and intercept | statsmodels | 344.3 | 1541.7 | **4.5×** |
356
- | clinical: diagnostic report (7 CIs) | statsmodels | 33.5 | 9.6 | 0.29× |
357
- | clinical: sensitivity, specificity, LR+, LR− | scikit-learn | 137.9 | 438.1 | **3.2×** |
358
- | decision curve: 99 thresholds | NumPy loop | 172.1 | 236.2 | **1.4×** |
359
- | detection: COCO evaluation (1000 images) | pycocotools | 1147.9 | 1351.0 | **1.2×** |
360
- | multiple testing: Hochberg (n p-values) | statsmodels | 91.9 | 98.4 | **1.1×** |
361
- | regression: MAE, MSE, RMSE, R² via evaluate() | scikit-learn | 32.0 | 22.6 | 0.71× |
362
- | retrieval: MRR, MAP@20, NDCG@10 (10000 queries) | ranx | 248.6 | 897.0 | **3.6×** |
363
- | segmentation: Dice and IoU per class (n = pixels) | scikit-learn | 51.6 | 289.5 | **5.6×** |
364
- | segmentation: Hausdorff distance (50 images) | SciPy | 31.9 | 23.8 | 0.75× |
365
- | statistics: Cramér's V (5×5 table) | SciPy | 0.3 | 0.3 | 0.95× |
366
- | statistics: Mann–Whitney U | SciPy | 390.3 | 425.8 | **1.1×** |
367
- | statistics: Welch t-test | SciPy | 37.7 | 16.3 | 0.43× |
368
- | structured: JSON Schema compliance (10000 documents) | jsonschema | 159.4 | 371.7 | **2.3×** |
369
- | systems: CodeBLEU n-gram terms (1000 programs) | codebleu | 740.3 | 791.9 | **1.1×** |
370
- | systems: confidence AUROC (n answers) | scikit-learn | 194.4 | 327.7 | **1.7×** |
371
- | systems: distribution-shift drop, Welch CI (n scores) | SciPy | 13.3 | 16.9 | **1.3×** |
372
- | systems: invalid tool calls vs JSON Schema (10000 tasks) | jsonschema | 145.0 | 333.2 | **2.3×** |
373
- | systems: latency p50 / p95 / p99 (n requests) | NumPy | 41.0 | 19.7 | 0.48× |
374
- | systems: maintainability index (1000 programs) | radon | 138.3 | 168.7 | **1.2×** |
375
- | text: corpus BLEU and chrF (10000 sentences) | sacreBLEU | 2726.2 | 3121.0 | **1.1×** |
376
- | text: METEOR, exact and stem matches (10000 sentences) | NLTK | 507.4 | 590.3 | **1.2×** |
377
- | text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score | 1147.3 | 1010.7 | 0.88× |
352
+ | 10 classes: macro F1 | scikit-learn | 7.0 | 115.9 | **16.5×** |
353
+ | agreement: Krippendorff's alpha, interval (4 raters × 10000 items) | krippendorff | 1.5 | 3.1 | **2.0×** |
354
+ | binary: 8 label metrics via evaluate() | scikit-learn | 8.8 | 865.8 | **98.0×** |
355
+ | binary: ROC AUC | scikit-learn | 163.6 | 284.5 | **1.7×** |
356
+ | calibration: slope and intercept | statsmodels | 182.1 | 1206.3 | **6.6×** |
357
+ | clinical: diagnostic report (7 CIs) | statsmodels | 5.0 | 5.4 | **1.1×** |
358
+ | clinical: sensitivity, specificity, LR+, LR− | scikit-learn | 21.3 | 330.3 | **15.5×** |
359
+ | decision curve: 99 thresholds | NumPy loop | 145.6 | 197.4 | **1.4×** |
360
+ | detection: COCO evaluation (1000 images) | pycocotools | 650.7 | 626.0 | 0.96× |
361
+ | multiple testing: Hochberg (n p-values) | statsmodels | 63.7 | 72.4 | **1.1×** |
362
+ | regression: MAE, MSE, RMSE, R² via evaluate() | scikit-learn | 8.4 | 14.7 | **1.8×** |
363
+ | retrieval: MRR, MAP@20, NDCG@10 (10000 queries) | ranx | 123.0 | 578.4 | **4.7×** |
364
+ | segmentation: Dice and IoU per class (n = pixels) | scikit-learn | 30.5 | 221.6 | **7.3×** |
365
+ | segmentation: Hausdorff distance (50 images) | SciPy | 12.3 | 13.7 | **1.1×** |
366
+ | statistics: Cramér's V (5×5 table) | SciPy | 0.0 | 0.2 | **11.9×** |
367
+ | statistics: Mann–Whitney U | SciPy | 136.9 | 286.2 | **2.1×** |
368
+ | statistics: Welch t-test | SciPy | 5.9 | 9.0 | **1.5×** |
369
+ | structured: JSON Schema compliance (10000 documents) | jsonschema | 96.9 | 228.0 | **2.4×** |
370
+ | systems: CodeBLEU n-gram terms (1000 programs) | codebleu | 423.0 | 509.6 | **1.2×** |
371
+ | systems: confidence AUROC (n answers) | scikit-learn | 164.1 | 254.1 | **1.5×** |
372
+ | systems: distribution-shift drop, Welch CI (n scores) | SciPy | 9.2 | 10.7 | **1.2×** |
373
+ | systems: invalid tool calls vs JSON Schema (10000 tasks) | jsonschema | 94.0 | 211.7 | **2.3×** |
374
+ | systems: latency p50 / p95 / p99 (n requests) | NumPy | 19.2 | 13.2 | 0.69× |
375
+ | systems: maintainability index (1000 programs) | radon | 89.2 | 95.4 | **1.1×** |
376
+ | text: corpus BLEU and chrF (10000 sentences) | sacreBLEU | 1454.2 | 1932.6 | **1.3×** |
377
+ | text: METEOR, exact and stem matches (10000 sentences) | NLTK | 323.9 | 384.1 | **1.2×** |
378
+ | text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score | 340.1 | 630.7 | **1.9×** |
378
379
 
379
380
  **Every metric is benchmarked too** (`evalsuite benchmark --suite metrics`): all 225 registered metrics and
380
381
  statistics functions at 10,000 and 100,000 samples. 86 are compared with a reference library, 118 with an
381
382
  independent textbook formula and 21 (learned, judge-dependent or randomised) are timed alone; **all 204
382
- comparisons agree**, and against the libraries the geometric-mean speed-up is **2.67×** (139 of 172
383
+ comparisons agree**, and against the libraries the geometric-mean speed-up is **4.67×** (165 of 172
383
384
  measurements faster). Per-metric table in BENCHMARKS.md.
384
385
 
385
- `evaluate()` validates inputs once and builds the confusion matrix once for all metrics, which is where most
386
- of the speed-up comes from. Hypothesis tests use SciPy underneath, so they match its speed at best; rows
387
- below 1× pay for input validation and the extra intervals and effect sizes EvalSuite reports. Reproduce on
386
+ `evaluate()` validates inputs once and builds the confusion matrix once for all metrics, and integer labels are
387
+ encoded without sorting, which is where most of the classification speed-up comes from. The rank tests
388
+ (Mann–Whitney, Wilcoxon, Kruskal–Wallis, Friedman) rank the data once with a single unstable sort; t-tests,
389
+ χ², Fisher and McNemar compute their statistics directly. The few rows below 1× either return more than the
390
+ reference (latency also reports mean, standard deviation, min, max and p90) or already call the reference's
391
+ compiled core (COCO matching, Shapiro–Wilk, MoverScore's transport solver). Reproduce on
388
392
  your machine with `evalsuite benchmark`; full table (1k, 100k and 1M samples, peak memory) and notes in
389
393
  [BENCHMARKS.md](https://github.com/mkcs28/evalsuite-python/blob/main/BENCHMARKS.md).
390
394
 
@@ -474,4 +478,10 @@ Authors and maintainers: **Manoj Kumar C S** and **Nikhil D Bharadwaj**.
474
478
 
475
479
  ## License
476
480
 
477
- MIT. See [LICENSE](LICENSE).
481
+ Dual-licensed under either of
482
+
483
+ - MIT license ([LICENSE](LICENSE))
484
+ - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
485
+
486
+ at your option. Unless you explicitly state otherwise, any contribution you submit for inclusion in this
487
+ project shall be dual-licensed as above, without any additional terms or conditions.
@@ -3,14 +3,14 @@
3
3
  [![CI](https://github.com/mkcs28/evalsuite-python/actions/workflows/ci.yml/badge.svg)](https://github.com/mkcs28/evalsuite-python/actions/workflows/ci.yml)
4
4
  [![PyPI](https://img.shields.io/pypi/v/evalsuite-python)](https://pypi.org/project/evalsuite-python/)
5
5
  [![Python](https://img.shields.io/pypi/pyversions/evalsuite-python)](https://pypi.org/project/evalsuite-python/)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
+ [![License: MIT OR Apache-2.0](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue.svg)](#license)
7
7
 
8
8
  **Unified, reproducible evaluation for machine learning, LLM and research.**
9
9
 
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 (0.5.2).** Every item on the 0.1.0–0.5.0 roadmaps is implemented and verified, including SPICE.
13
+ > **Status: stable (0.5.4).** Every item on the 0.1.0–0.5.0 roadmaps is implemented and verified, including SPICE.
14
14
  > **LLM systems arrive in 0.5.0**: safety, robustness, calibration and uncertainty, agents and tool use,
15
15
  > multilingual, code generation, long context and summarization, and inference efficiency and cost.
16
16
 
@@ -266,52 +266,55 @@ Input files can be CSV, TSV, Parquet or JSON. Output format follows `--format` o
266
266
 
267
267
  ## Performance
268
268
 
269
- Benchmarked against reference implementations on the same data (fastest of 5 runs; EvalSuite 0.5.1, Python 3.13,
269
+ Benchmarked against reference implementations on the same data (fastest of 5 runs; EvalSuite 0.5.4, Python 3.13,
270
270
  NumPy 2.5, Linux x86_64). **Overall: 81 of 81 rows agree with the reference** (largest
271
- difference 2.5e-14), 56 are faster, and the geometric-mean speed-up across all
272
- 27 cases and three sizes is **1.89×**. At 1,000,000 samples (pixels for
271
+ difference 2.5e-14), 75 are faster, and the geometric-mean speed-up across all
272
+ 27 cases and three sizes is **3.07×**. At 1,000,000 samples (pixels for
273
273
  segmentation; 1,000 images for detection and 50 for Hausdorff; 10,000 examples for the LLM cases), in
274
274
  alphabetical order:
275
275
 
276
276
  | Case | Reference | EvalSuite (ms) | Reference (ms) | Speed-up |
277
277
  | --- | --- | ---: | ---: | ---: |
278
- | 10 classes: macro F1 | scikit-learn | 41.5 | 137.6 | **3.3×** |
279
- | agreement: Krippendorff's alpha, interval (4 raters × 10000 items) | krippendorff | 4.5 | 4.5 | **1.0×** |
280
- | binary: 8 label metrics via evaluate() | scikit-learn | 49.4 | 1056.8 | **21.4×** |
281
- | binary: ROC AUC | scikit-learn | 200.3 | 338.5 | **1.7×** |
282
- | calibration: slope and intercept | statsmodels | 344.3 | 1541.7 | **4.5×** |
283
- | clinical: diagnostic report (7 CIs) | statsmodels | 33.5 | 9.6 | 0.29× |
284
- | clinical: sensitivity, specificity, LR+, LR− | scikit-learn | 137.9 | 438.1 | **3.2×** |
285
- | decision curve: 99 thresholds | NumPy loop | 172.1 | 236.2 | **1.4×** |
286
- | detection: COCO evaluation (1000 images) | pycocotools | 1147.9 | 1351.0 | **1.2×** |
287
- | multiple testing: Hochberg (n p-values) | statsmodels | 91.9 | 98.4 | **1.1×** |
288
- | regression: MAE, MSE, RMSE, R² via evaluate() | scikit-learn | 32.0 | 22.6 | 0.71× |
289
- | retrieval: MRR, MAP@20, NDCG@10 (10000 queries) | ranx | 248.6 | 897.0 | **3.6×** |
290
- | segmentation: Dice and IoU per class (n = pixels) | scikit-learn | 51.6 | 289.5 | **5.6×** |
291
- | segmentation: Hausdorff distance (50 images) | SciPy | 31.9 | 23.8 | 0.75× |
292
- | statistics: Cramér's V (5×5 table) | SciPy | 0.3 | 0.3 | 0.95× |
293
- | statistics: Mann–Whitney U | SciPy | 390.3 | 425.8 | **1.1×** |
294
- | statistics: Welch t-test | SciPy | 37.7 | 16.3 | 0.43× |
295
- | structured: JSON Schema compliance (10000 documents) | jsonschema | 159.4 | 371.7 | **2.3×** |
296
- | systems: CodeBLEU n-gram terms (1000 programs) | codebleu | 740.3 | 791.9 | **1.1×** |
297
- | systems: confidence AUROC (n answers) | scikit-learn | 194.4 | 327.7 | **1.7×** |
298
- | systems: distribution-shift drop, Welch CI (n scores) | SciPy | 13.3 | 16.9 | **1.3×** |
299
- | systems: invalid tool calls vs JSON Schema (10000 tasks) | jsonschema | 145.0 | 333.2 | **2.3×** |
300
- | systems: latency p50 / p95 / p99 (n requests) | NumPy | 41.0 | 19.7 | 0.48× |
301
- | systems: maintainability index (1000 programs) | radon | 138.3 | 168.7 | **1.2×** |
302
- | text: corpus BLEU and chrF (10000 sentences) | sacreBLEU | 2726.2 | 3121.0 | **1.1×** |
303
- | text: METEOR, exact and stem matches (10000 sentences) | NLTK | 507.4 | 590.3 | **1.2×** |
304
- | text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score | 1147.3 | 1010.7 | 0.88× |
278
+ | 10 classes: macro F1 | scikit-learn | 7.0 | 115.9 | **16.5×** |
279
+ | agreement: Krippendorff's alpha, interval (4 raters × 10000 items) | krippendorff | 1.5 | 3.1 | **2.0×** |
280
+ | binary: 8 label metrics via evaluate() | scikit-learn | 8.8 | 865.8 | **98.0×** |
281
+ | binary: ROC AUC | scikit-learn | 163.6 | 284.5 | **1.7×** |
282
+ | calibration: slope and intercept | statsmodels | 182.1 | 1206.3 | **6.6×** |
283
+ | clinical: diagnostic report (7 CIs) | statsmodels | 5.0 | 5.4 | **1.1×** |
284
+ | clinical: sensitivity, specificity, LR+, LR− | scikit-learn | 21.3 | 330.3 | **15.5×** |
285
+ | decision curve: 99 thresholds | NumPy loop | 145.6 | 197.4 | **1.4×** |
286
+ | detection: COCO evaluation (1000 images) | pycocotools | 650.7 | 626.0 | 0.96× |
287
+ | multiple testing: Hochberg (n p-values) | statsmodels | 63.7 | 72.4 | **1.1×** |
288
+ | regression: MAE, MSE, RMSE, R² via evaluate() | scikit-learn | 8.4 | 14.7 | **1.8×** |
289
+ | retrieval: MRR, MAP@20, NDCG@10 (10000 queries) | ranx | 123.0 | 578.4 | **4.7×** |
290
+ | segmentation: Dice and IoU per class (n = pixels) | scikit-learn | 30.5 | 221.6 | **7.3×** |
291
+ | segmentation: Hausdorff distance (50 images) | SciPy | 12.3 | 13.7 | **1.1×** |
292
+ | statistics: Cramér's V (5×5 table) | SciPy | 0.0 | 0.2 | **11.9×** |
293
+ | statistics: Mann–Whitney U | SciPy | 136.9 | 286.2 | **2.1×** |
294
+ | statistics: Welch t-test | SciPy | 5.9 | 9.0 | **1.5×** |
295
+ | structured: JSON Schema compliance (10000 documents) | jsonschema | 96.9 | 228.0 | **2.4×** |
296
+ | systems: CodeBLEU n-gram terms (1000 programs) | codebleu | 423.0 | 509.6 | **1.2×** |
297
+ | systems: confidence AUROC (n answers) | scikit-learn | 164.1 | 254.1 | **1.5×** |
298
+ | systems: distribution-shift drop, Welch CI (n scores) | SciPy | 9.2 | 10.7 | **1.2×** |
299
+ | systems: invalid tool calls vs JSON Schema (10000 tasks) | jsonschema | 94.0 | 211.7 | **2.3×** |
300
+ | systems: latency p50 / p95 / p99 (n requests) | NumPy | 19.2 | 13.2 | 0.69× |
301
+ | systems: maintainability index (1000 programs) | radon | 89.2 | 95.4 | **1.1×** |
302
+ | text: corpus BLEU and chrF (10000 sentences) | sacreBLEU | 1454.2 | 1932.6 | **1.3×** |
303
+ | text: METEOR, exact and stem matches (10000 sentences) | NLTK | 323.9 | 384.1 | **1.2×** |
304
+ | text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score | 340.1 | 630.7 | **1.9×** |
305
305
 
306
306
  **Every metric is benchmarked too** (`evalsuite benchmark --suite metrics`): all 225 registered metrics and
307
307
  statistics functions at 10,000 and 100,000 samples. 86 are compared with a reference library, 118 with an
308
308
  independent textbook formula and 21 (learned, judge-dependent or randomised) are timed alone; **all 204
309
- comparisons agree**, and against the libraries the geometric-mean speed-up is **2.67×** (139 of 172
309
+ comparisons agree**, and against the libraries the geometric-mean speed-up is **4.67×** (165 of 172
310
310
  measurements faster). Per-metric table in BENCHMARKS.md.
311
311
 
312
- `evaluate()` validates inputs once and builds the confusion matrix once for all metrics, which is where most
313
- of the speed-up comes from. Hypothesis tests use SciPy underneath, so they match its speed at best; rows
314
- below 1× pay for input validation and the extra intervals and effect sizes EvalSuite reports. Reproduce on
312
+ `evaluate()` validates inputs once and builds the confusion matrix once for all metrics, and integer labels are
313
+ encoded without sorting, which is where most of the classification speed-up comes from. The rank tests
314
+ (Mann–Whitney, Wilcoxon, Kruskal–Wallis, Friedman) rank the data once with a single unstable sort; t-tests,
315
+ χ², Fisher and McNemar compute their statistics directly. The few rows below 1× either return more than the
316
+ reference (latency also reports mean, standard deviation, min, max and p90) or already call the reference's
317
+ compiled core (COCO matching, Shapiro–Wilk, MoverScore's transport solver). Reproduce on
315
318
  your machine with `evalsuite benchmark`; full table (1k, 100k and 1M samples, peak memory) and notes in
316
319
  [BENCHMARKS.md](https://github.com/mkcs28/evalsuite-python/blob/main/BENCHMARKS.md).
317
320
 
@@ -401,4 +404,10 @@ Authors and maintainers: **Manoj Kumar C S** and **Nikhil D Bharadwaj**.
401
404
 
402
405
  ## License
403
406
 
404
- MIT. See [LICENSE](LICENSE).
407
+ Dual-licensed under either of
408
+
409
+ - MIT license ([LICENSE](LICENSE))
410
+ - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
411
+
412
+ at your option. Unless you explicitly state otherwise, any contribution you submit for inclusion in this
413
+ project shall be dual-licensed as above, without any additional terms or conditions.
@@ -7,8 +7,8 @@ name = "evalsuite-python"
7
7
  dynamic = ["version"]
8
8
  description = "A unified Python framework for machine-learning, clinical, statistical, segmentation, object-detection, uncertainty, and model evaluation."
9
9
  readme = "README.md"
10
- license = "MIT"
11
- license-files = ["LICENSE"]
10
+ license = "MIT OR Apache-2.0"
11
+ license-files = ["LICENSE", "LICENSE-APACHE"]
12
12
  requires-python = ">=3.9"
13
13
  authors = [{ name = "Manoj Kumar C S" }, { name = "Nikhil D Bharadwaj" }]
14
14
  maintainers = [{ name = "Manoj Kumar C S" }, { name = "Nikhil D Bharadwaj" }]
@@ -92,7 +92,23 @@ class ClassificationContext:
92
92
  def _index(self) -> dict[Any, int]:
93
93
  return {lab.item() if hasattr(lab, "item") else lab: i for i, lab in enumerate(self.labels)}
94
94
 
95
+ @cached_property
96
+ def _contiguous_int_labels(self) -> Optional[int]:
97
+ """The first label when labels are consecutive integers lo, lo+1, …; encoding is then y − lo."""
98
+ lab = self.labels
99
+ if (
100
+ lab.dtype.kind in "iu"
101
+ and lab.size
102
+ and np.array_equal(lab, np.arange(int(lab[0]), int(lab[0]) + lab.size))
103
+ ):
104
+ return int(lab[0])
105
+ return None
106
+
95
107
  def encode(self, y: NDArray[Any]) -> NDArray[np.int64]:
108
+ lo = self._contiguous_int_labels
109
+ if lo is not None and y.dtype.kind in "iu":
110
+ yi = y.astype(np.int64, copy=False)
111
+ return yi - lo if lo else yi
96
112
  sorted_labels = np.all(self.labels[:-1] <= self.labels[1:]) if self.labels.dtype != object else False
97
113
  if sorted_labels:
98
114
  return np.searchsorted(self.labels, y).astype(np.int64)
@@ -123,6 +139,8 @@ class ClassificationContext:
123
139
  )
124
140
  k = self.labels.shape[0]
125
141
  flat = self.true_idx * k + self.pred_idx
142
+ if self.sample_weight is None: # integer counting is faster than summing unit weights
143
+ return np.bincount(flat, minlength=k * k).reshape(k, k).astype(np.float64)
126
144
  return np.bincount(flat, weights=self.weights, minlength=k * k).reshape(k, k).astype(np.float64)
127
145
 
128
146
  @cached_property
@@ -65,7 +65,7 @@ def _label_kind(arr: NDArray[Any]) -> str:
65
65
 
66
66
 
67
67
  def check_finite(arr: NDArray[Any], name: str) -> None:
68
- if np.issubdtype(arr.dtype, np.number) and not np.all(np.isfinite(arr)):
68
+ if arr.dtype.kind in "fc" and not np.all(np.isfinite(arr)): # integers and booleans are always finite
69
69
  n_nan = int(np.isnan(arr).sum())
70
70
  n_inf = int(np.isinf(arr).sum())
71
71
  raise InputValidationError(
@@ -104,25 +104,38 @@ def unique_labels(y: NDArray[Any]) -> NDArray[Any]:
104
104
  are found with one marking pass instead of a sort, which is several times faster on large arrays."""
105
105
  if y.size and np.issubdtype(y.dtype, np.integer):
106
106
  lo, hi = int(y.min()), int(y.max())
107
+ if hi - lo <= 1: # min and max are themselves the labels (the binary case): no counting pass
108
+ return np.array([lo] if hi == lo else [lo, hi], dtype=y.dtype)
107
109
  if lo > -(2**62) and hi < 2**62 and hi - lo <= max(1024, y.size):
108
- present = np.zeros(hi - lo + 1, dtype=bool)
109
- present[(y.astype(np.int64) - lo).ravel()] = True # int64 offsets: no overflow for small dtypes
110
- return (np.flatnonzero(present).astype(np.int64) + lo).astype(y.dtype)
110
+ flat = y.ravel()
111
+ # bincount counts in one pass; offsets in int64 so small dtypes cannot overflow.
112
+ counts = np.bincount(flat if lo == 0 and flat.dtype.itemsize <= 8 else flat.astype(np.int64) - lo)
113
+ return (np.flatnonzero(counts).astype(np.int64) + lo).astype(y.dtype)
111
114
  return np.unique(y)
112
115
 
113
116
 
117
+ def _has_fraction(y: NDArray[Any]) -> bool:
118
+ """Whether any value is non-integral. Real-valued targets almost always show it in the first few values,
119
+ so a short leading chunk is checked before the whole array."""
120
+ flat = y.ravel()
121
+ head = flat[:1024]
122
+ if not np.all(np.mod(head, 1) == 0):
123
+ return True
124
+ return flat.size > head.size and not np.all(np.mod(flat[head.size :], 1) == 0)
125
+
126
+
114
127
  def target_type(y: NDArray[Any]) -> TargetType:
115
128
  """Infer the type of a label array."""
116
129
  if y.ndim == 2:
117
130
  if y.shape[1] > 1 and np.isin(y, (0, 1)).all():
118
131
  return "multilabel"
119
- if np.issubdtype(y.dtype, np.floating) and not np.all(np.mod(y, 1) == 0):
132
+ if np.issubdtype(y.dtype, np.floating) and _has_fraction(y):
120
133
  return "continuous" # multi-output regression
121
134
  raise InputValidationError(
122
135
  "2-D targets must be a binary indicator matrix (0/1, one column per label) for multilabel tasks; "
123
136
  f"received shape {y.shape} with values other than 0 and 1."
124
137
  )
125
- if np.issubdtype(y.dtype, np.floating) and not np.all(np.mod(y, 1) == 0):
138
+ if np.issubdtype(y.dtype, np.floating) and _has_fraction(y):
126
139
  return "continuous"
127
140
  try:
128
141
  n_unique = unique_labels(y).shape[0]
@@ -147,6 +160,14 @@ def resolve_labels(
147
160
  f"y_true has {_label_kind(y_true)} labels but y_pred has {_label_kind(y_pred)} labels; "
148
161
  "use the same label type in both (for example map class names to integers first)."
149
162
  )
163
+ if (
164
+ y_pred is not None
165
+ and np.issubdtype(y_true.dtype, np.integer)
166
+ and np.issubdtype(y_pred.dtype, np.integer)
167
+ and y_true.dtype == y_pred.dtype
168
+ ):
169
+ # Union of each array's labels: no concatenated copy of the data.
170
+ return np.union1d(unique_labels(y_true), unique_labels(y_pred)).astype(y_true.dtype)
150
171
  present = y_true if y_pred is None else np.concatenate([y_true, y_pred])
151
172
  try:
152
173
  return unique_labels(present)