evalsuite-python 1.1.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.1.0 → evalsuite_python-1.1.1}/CHANGELOG.md +31 -0
  2. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/PKG-INFO +2 -2
  3. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/README.md +1 -1
  4. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/Cargo.lock +6 -6
  5. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/Cargo.toml +1 -1
  6. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/api.py +34 -7
  7. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/version.py +1 -1
  8. evalsuite_python-1.1.1/tests/test_v111_fixes.py +31 -0
  9. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/CONTRIBUTING.md +0 -0
  10. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/LICENSE +0 -0
  11. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/LICENSE-APACHE +0 -0
  12. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/pyproject.toml +0 -0
  13. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/Cargo.toml +0 -0
  14. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/README.md +0 -0
  15. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/agreement.rs +0 -0
  16. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/coco.rs +0 -0
  17. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/curve.rs +0 -0
  18. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/groups.rs +0 -0
  19. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/hash.rs +0 -0
  20. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/lib.rs +0 -0
  21. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/meteor.rs +0 -0
  22. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/permutation.rs +0 -0
  23. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/qa.rs +0 -0
  24. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/ranks.rs +0 -0
  25. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/resample.rs +0 -0
  26. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/surface.rs +0 -0
  27. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/ter.rs +0 -0
  28. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-core/src/text.rs +0 -0
  29. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-py/Cargo.toml +0 -0
  30. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/rust/evalsuite-py/src/lib.rs +0 -0
  31. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/__init__.py +0 -0
  32. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/__main__.py +0 -0
  33. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/_bench_metrics.py +0 -0
  34. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/_evalci.py +0 -0
  35. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/_lazy.py +0 -0
  36. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/_native.py +0 -0
  37. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/benchmarks.py +0 -0
  38. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/calibration.py +0 -0
  39. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/cards.py +0 -0
  40. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/classification/__init__.py +0 -0
  41. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/classification/_common.py +0 -0
  42. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/classification/metrics.py +0 -0
  43. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/cli/__init__.py +0 -0
  44. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/cli/main.py +0 -0
  45. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/clinical/__init__.py +0 -0
  46. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/clinical/metrics.py +0 -0
  47. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/clinical/report.py +0 -0
  48. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/core/__init__.py +0 -0
  49. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/core/context.py +0 -0
  50. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/core/exceptions.py +0 -0
  51. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/core/export.py +0 -0
  52. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/core/registry.py +0 -0
  53. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/core/result.py +0 -0
  54. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/core/types.py +0 -0
  55. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/core/validation.py +0 -0
  56. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/harness.py +0 -0
  57. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/integrations.py +0 -0
  58. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/__init__.py +0 -0
  59. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/_common.py +0 -0
  60. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/agents.py +0 -0
  61. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/code.py +0 -0
  62. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/efficiency.py +0 -0
  63. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/longcontext.py +0 -0
  64. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/multilingual.py +0 -0
  65. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/robustness.py +0 -0
  66. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/safety.py +0 -0
  67. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/llmsys/uncertainty.py +0 -0
  68. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/monitor.py +0 -0
  69. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/plot.py +0 -0
  70. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/py.typed +0 -0
  71. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/regression/__init__.py +0 -0
  72. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/regression/metrics.py +0 -0
  73. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/reporting.py +0 -0
  74. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/__init__.py +0 -0
  75. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/_resolve.py +0 -0
  76. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/compare.py +0 -0
  77. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/effect.py +0 -0
  78. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/hypothesis.py +0 -0
  79. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/intervals.py +0 -0
  80. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/paired.py +0 -0
  81. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/stats/results.py +0 -0
  82. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/__init__.py +0 -0
  83. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/_common.py +0 -0
  84. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/factuality.py +0 -0
  85. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/generation.py +0 -0
  86. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/judge.py +0 -0
  87. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/qa.py +0 -0
  88. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/rag.py +0 -0
  89. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/reasoning.py +0 -0
  90. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/report.py +0 -0
  91. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/retrieval.py +0 -0
  92. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/semantic.py +0 -0
  93. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/spice.py +0 -0
  94. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/text/structured.py +0 -0
  95. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/vision/__init__.py +0 -0
  96. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/vision/detection.py +0 -0
  97. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/src/evalsuite/vision/segmentation.py +0 -0
  98. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/__init__.py +0 -0
  99. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/classification/__init__.py +0 -0
  100. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/classification/test_against_sklearn.py +0 -0
  101. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/clinical/__init__.py +0 -0
  102. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/clinical/test_outputs.py +0 -0
  103. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/clinical/test_v020.py +0 -0
  104. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/conftest.py +0 -0
  105. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/integration/__init__.py +0 -0
  106. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/integration/test_qa.py +0 -0
  107. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/integration/test_readme_examples.py +0 -0
  108. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/integration/test_repo_hygiene.py +0 -0
  109. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/llmsys/__init__.py +0 -0
  110. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/llmsys/test_code_longcontext_efficiency.py +0 -0
  111. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/llmsys/test_edges.py +0 -0
  112. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/llmsys/test_fast_text.py +0 -0
  113. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/llmsys/test_hardening.py +0 -0
  114. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/llmsys/test_safety_robustness.py +0 -0
  115. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/llmsys/test_uncertainty_agents_multilingual.py +0 -0
  116. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/output/__init__.py +0 -0
  117. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/output/test_benchmarks.py +0 -0
  118. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/output/test_cli.py +0 -0
  119. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/output/test_plot.py +0 -0
  120. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/output/test_reporting.py +0 -0
  121. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/regression/__init__.py +0 -0
  122. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/regression/test_against_sklearn.py +0 -0
  123. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/stats/__init__.py +0 -0
  124. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/stats/test_branches.py +0 -0
  125. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/stats/test_compare.py +0 -0
  126. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/stats/test_fast_paths.py +0 -0
  127. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/stats/test_reference.py +0 -0
  128. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/test_cards.py +0 -0
  129. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/test_harness.py +0 -0
  130. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/test_integrations.py +0 -0
  131. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/test_monitor.py +0 -0
  132. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/test_native.py +0 -0
  133. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/text/__init__.py +0 -0
  134. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/text/test_against_references.py +0 -0
  135. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/text/test_text_edges.py +0 -0
  136. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/text/test_v040.py +0 -0
  137. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/unit/__init__.py +0 -0
  138. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/unit/test_core.py +0 -0
  139. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/unit/test_edges.py +0 -0
  140. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/vision/__init__.py +0 -0
  141. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/vision/test_detection.py +0 -0
  142. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/vision/test_edges.py +0 -0
  143. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/vision/test_outputs.py +0 -0
  144. {evalsuite_python-1.1.0 → evalsuite_python-1.1.1}/tests/vision/test_segmentation.py +0 -0
@@ -6,6 +6,37 @@ 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
+
9
40
  ## [1.1.0] - 2026-11-26
10
41
 
11
42
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evalsuite-python
3
- Version: 1.1.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.1.0).** Try it in Colab: [example notebooks](notebooks/README.md). **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.1.0).** Try it in Colab: [example notebooks](notebooks/README.md). **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.
@@ -319,7 +319,7 @@ checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
319
319
 
320
320
  [[package]]
321
321
  name = "evalsuite"
322
- version = "1.1.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.1.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.1.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.1.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.1.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.1.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.1.0"
6
+ version = "1.1.1"
7
7
  edition = "2021"
8
8
  rust-version = "1.82"
9
9
  license = "MIT OR Apache-2.0"
@@ -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.1.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"