evalsuite-python 0.5.5__tar.gz → 0.6.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.
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/CHANGELOG.md +55 -0
- evalsuite_python-0.6.1/CONTRIBUTING.md +51 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/PKG-INFO +117 -85
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/README.md +64 -34
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/pyproject.toml +24 -3
- evalsuite_python-0.6.1/rust/Cargo.lock +192 -0
- evalsuite_python-0.6.1/rust/Cargo.toml +18 -0
- evalsuite_python-0.6.1/rust/evalsuite-core/Cargo.toml +15 -0
- evalsuite_python-0.6.1/rust/evalsuite-core/README.md +10 -0
- evalsuite_python-0.6.1/rust/evalsuite-core/src/coco.rs +325 -0
- evalsuite_python-0.6.1/rust/evalsuite-core/src/hash.rs +70 -0
- evalsuite_python-0.6.1/rust/evalsuite-core/src/lib.rs +13 -0
- evalsuite_python-0.6.1/rust/evalsuite-core/src/meteor.rs +72 -0
- evalsuite_python-0.6.1/rust/evalsuite-core/src/resample.rs +162 -0
- evalsuite_python-0.6.1/rust/evalsuite-core/src/ter.rs +304 -0
- evalsuite_python-0.6.1/rust/evalsuite-core/src/text.rs +520 -0
- evalsuite_python-0.6.1/rust/evalsuite-py/Cargo.toml +19 -0
- evalsuite_python-0.6.1/rust/evalsuite-py/src/lib.rs +579 -0
- evalsuite_python-0.6.1/src/evalsuite/_native.py +65 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/code.py +10 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/stats/_resolve.py +92 -1
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/stats/compare.py +5 -2
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/stats/intervals.py +74 -18
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/stats/paired.py +6 -1
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/generation.py +191 -38
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/version.py +1 -1
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/vision/detection.py +71 -0
- evalsuite_python-0.6.1/tests/test_native.py +332 -0
- evalsuite_python-0.5.5/.gitignore +0 -19
- evalsuite_python-0.5.5/CONTRIBUTING.md +0 -26
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/LICENSE +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/LICENSE-APACHE +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/__main__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/_bench_metrics.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/_lazy.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/api.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/benchmarks.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/calibration.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/classification/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/classification/_common.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/classification/metrics.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/cli/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/cli/main.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/clinical/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/clinical/metrics.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/clinical/report.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/core/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/core/context.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/core/exceptions.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/core/export.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/core/registry.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/core/result.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/core/types.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/core/validation.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/_common.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/agents.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/efficiency.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/longcontext.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/multilingual.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/robustness.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/safety.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/llmsys/uncertainty.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/plot.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/py.typed +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/regression/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/regression/metrics.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/reporting.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/stats/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/stats/effect.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/stats/hypothesis.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/stats/results.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/_common.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/factuality.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/judge.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/qa.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/rag.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/reasoning.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/report.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/retrieval.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/semantic.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/spice.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/text/structured.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/vision/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/src/evalsuite/vision/segmentation.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/classification/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/classification/test_against_sklearn.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/clinical/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/clinical/test_outputs.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/clinical/test_v020.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/conftest.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/integration/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/integration/test_qa.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/integration/test_readme_examples.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/integration/test_repo_hygiene.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/llmsys/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/llmsys/test_code_longcontext_efficiency.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/llmsys/test_edges.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/llmsys/test_fast_text.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/llmsys/test_hardening.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/llmsys/test_safety_robustness.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/llmsys/test_uncertainty_agents_multilingual.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/output/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/output/test_benchmarks.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/output/test_cli.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/output/test_plot.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/output/test_reporting.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/regression/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/regression/test_against_sklearn.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/stats/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/stats/test_branches.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/stats/test_compare.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/stats/test_fast_paths.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/stats/test_reference.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/text/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/text/test_against_references.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/text/test_text_edges.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/text/test_v040.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/unit/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/unit/test_core.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/unit/test_edges.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/vision/__init__.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/vision/test_detection.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/vision/test_edges.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/vision/test_outputs.py +0 -0
- {evalsuite_python-0.5.5 → evalsuite_python-0.6.1}/tests/vision/test_segmentation.py +0 -0
|
@@ -6,6 +6,61 @@ All notable changes to this project are documented here. The format follows
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.6.1] - 2026-11-24
|
|
10
|
+
|
|
11
|
+
Finishes the Rust port. Results are unchanged (bit-identical to the Python reference) unless you opt in to
|
|
12
|
+
`resampling="native"`.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- Whole COCO evaluation in the core: IoU matrices (with the crowd rule), stable descending score sort, ignored
|
|
16
|
+
ground truth, greedy matching, precision/recall accumulation and the 101-point interpolation, in parallel
|
|
17
|
+
over classes (`detection_report`, `mean_average_precision`).
|
|
18
|
+
- Compiled CIDEr-D, CodeBLEU (n-gram and keyword-weighted n-gram terms) and distinct-n.
|
|
19
|
+
- Multithreading: every per-example kernel (BLEU, chrF, TER, ROUGE, METEOR, CIDEr, CodeBLEU, COCO, resample
|
|
20
|
+
counting) runs on all cores; `EVALSUITE_NUM_THREADS` caps the threads. Sums stay in example order, so the
|
|
21
|
+
thread count never changes a result.
|
|
22
|
+
- Opt-in `resampling="native"` for `bootstrap_ci`, `paired_bootstrap_test` and `compare`: resample indices are
|
|
23
|
+
drawn in the core (seeded xoshiro256++, one stream per resample, written straight into the index array).
|
|
24
|
+
About 3× faster bootstrap on 100,000 observations; reproducible with `random_state` and independent of the
|
|
25
|
+
thread count, but a different random stream from the default `"numpy"`. The default is unchanged.
|
|
26
|
+
- Parity tests for the new kernels, tied scores and user areas in COCO, thread-count invariance and native
|
|
27
|
+
resampling.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- The ported float sums follow the running interpreter's built-in `sum()` (compensated summation on Python
|
|
31
|
+
3.12+, sequential before), so CIDEr and CodeBLEU agree with the Python path to the last bit on every Python.
|
|
32
|
+
|
|
33
|
+
## [0.6.0] - 2026-11-24
|
|
34
|
+
|
|
35
|
+
EvalSuite now has a **compiled core written in Rust**. The public API is unchanged and every result is identical:
|
|
36
|
+
each kernel is a direct port of the Python implementation it replaces, which stays as the reference and as the
|
|
37
|
+
fallback, and the two are tested against each other for every kernel.
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
- `evalsuite._core`, built from `rust/` (crates `evalsuite-core`, pure Rust, and `evalsuite-py`, the PyO3
|
|
41
|
+
bindings) with maturin. Binary wheels for Linux (x86_64, aarch64; glibc and musl), macOS (arm64, x86_64) and
|
|
42
|
+
Windows (x64, arm64), each built for the stable ABI so one wheel serves Python 3.9 to 3.14.
|
|
43
|
+
- A pure-Python wheel (`py3-none-any`): pip installs it only where no binary wheel fits, and EvalSuite then runs
|
|
44
|
+
its Python implementations with the same results. `EVALSUITE_PURE_PYTHON=1` selects them on any install;
|
|
45
|
+
`evalsuite._native.backend()` reports `"rust"` or `"python"`.
|
|
46
|
+
- Compiled kernels: TER (beam edit distance with block shifts), BLEU / self-BLEU / sentence-BLEU statistics,
|
|
47
|
+
chrF and chrF++ statistics, ROUGE-N overlaps, ROUGE-L and ROUGE-Lsum longest common subsequences, METEOR
|
|
48
|
+
alignment, COCO detection matching, and bootstrap resample counting.
|
|
49
|
+
- Bootstrap intervals, paired bootstrap tests and `compare()` evaluate confusion-matrix metrics (accuracy,
|
|
50
|
+
balanced accuracy, Cohen's kappa, F1, F-beta, Jaccard, MCC, NPV, precision, recall, specificity) from counts
|
|
51
|
+
of each resample's (true, predicted) pairs instead of the resampled observations, and the BCa jackknife from
|
|
52
|
+
the full counts minus each block's: identical values, no per-resample copies of the data.
|
|
53
|
+
- `tests/test_native.py`: parity of every kernel with its Python reference; CI runs the whole suite with and
|
|
54
|
+
without the core and requires the binary wheel, the pure wheel and the sdist to give identical results.
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
- Benchmarks: overall geometric-mean speed-up 3.29× → **3.70×** (81 of 81 rows faster), per-metric speed-up
|
|
58
|
+
against reference libraries 4.97× → **5.99×** (172 of 172 faster); every comparison still agrees.
|
|
59
|
+
- Against 0.5.5: TER about 12× faster (now about 19× sacreBLEU), self-BLEU 10×, chrF 7×, BLEU and ROUGE 2–5×,
|
|
60
|
+
METEOR 2×, bootstrap confidence intervals about 5×, paired bootstrap tests and `compare()` about 2×.
|
|
61
|
+
Corpus BLEU and chrF together are now 8.3× sacreBLEU, METEOR 4.9× NLTK and COCO evaluation 2.3× pycocotools.
|
|
62
|
+
- Build backend: maturin (was hatchling); building from the sdist needs a Rust toolchain.
|
|
63
|
+
|
|
9
64
|
## [0.5.5] - 2026-11-09
|
|
10
65
|
|
|
11
66
|
Every benchmark row is now faster than its reference library: 81 of 81 in the main benchmark (geometric mean
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Contributing to EvalSuite
|
|
2
|
+
|
|
3
|
+
Thank you for helping. EvalSuite values correctness and clarity over breadth.
|
|
4
|
+
|
|
5
|
+
## Development setup
|
|
6
|
+
|
|
7
|
+
EvalSuite has a compiled core written in Rust (`rust/`), built into `evalsuite._core` by
|
|
8
|
+
[maturin](https://www.maturin.rs). Install a Rust toolchain ([rustup](https://rustup.rs)), then:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install -e ".[dev]" # builds the core; rerun after changing anything under rust/
|
|
12
|
+
python -c "from evalsuite import _native; print(_native.backend())" # rust
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Every function with a compiled kernel keeps its Python implementation as the reference and fallback. Set
|
|
16
|
+
`EVALSUITE_PURE_PYTHON=1` to run without the core; `tests/test_native.py` checks that both give identical
|
|
17
|
+
results, and must keep passing.
|
|
18
|
+
|
|
19
|
+
## Adding or changing a compiled kernel
|
|
20
|
+
|
|
21
|
+
1. Port the Python reference operation for operation (same counts, tie-breaks and floating-point order) into
|
|
22
|
+
`rust/evalsuite-core` (pure Rust, no Python), and expose it in `rust/evalsuite-py`.
|
|
23
|
+
2. Keep the Python path and call the core from it only when `evalsuite._native.core` is available.
|
|
24
|
+
3. Add a parity test to `tests/test_native.py` comparing both paths, then run the checks below.
|
|
25
|
+
|
|
26
|
+
## Adding or changing a metric
|
|
27
|
+
|
|
28
|
+
1. Implement it with `@register(...)`: definition, formula, range, input requirements and at least one
|
|
29
|
+
reference.
|
|
30
|
+
2. Validate inputs through `evalsuite.core.validation`; raise `InputValidationError` for bad inputs and
|
|
31
|
+
`MetricInputError` for values outside the metric's domain, with a message saying how to fix it.
|
|
32
|
+
3. Test it: against an established implementation where definitions coincide (scikit-learn, SciPy), plus
|
|
33
|
+
hand-computed cases, edge cases and, where useful, property-based tests.
|
|
34
|
+
4. Document conventions explicitly (averaging, label order, zero division) and update `CHANGELOG.md`.
|
|
35
|
+
|
|
36
|
+
## Checks
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pytest --cov=evalsuite # coverage must stay at or above 95% for core modules
|
|
40
|
+
EVALSUITE_PURE_PYTHON=1 pytest -q # the same suite without the compiled core
|
|
41
|
+
ruff check . && ruff format --check .
|
|
42
|
+
mypy # strict
|
|
43
|
+
cargo fmt --manifest-path rust/Cargo.toml --all --check
|
|
44
|
+
cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
|
|
45
|
+
cargo test --manifest-path rust/Cargo.toml -p evalsuite-core
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Reporting issues
|
|
49
|
+
|
|
50
|
+
Include the EvalSuite, Python and NumPy versions, a minimal example, the expected result (with a reference)
|
|
51
|
+
and the actual result.
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: evalsuite-python
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: A unified Python framework for machine-learning, clinical, statistical, segmentation, object-detection, uncertainty, and model evaluation.
|
|
5
|
-
Project-URL: Homepage, https://evalsuite-nine.vercel.app
|
|
6
|
-
Project-URL: Documentation, https://evalsuite-nine.vercel.app/docs
|
|
7
|
-
Project-URL: Source, https://github.com/mkcs28/evalsuite-python
|
|
8
|
-
Project-URL: Issues, https://github.com/mkcs28/evalsuite-python/issues
|
|
9
|
-
Project-URL: Changelog, https://github.com/mkcs28/evalsuite-python/blob/main/CHANGELOG.md
|
|
10
|
-
Author: Manoj Kumar C S, Nikhil D Bharadwaj
|
|
11
|
-
Maintainer: Manoj Kumar C S, Nikhil D Bharadwaj
|
|
12
|
-
License-Expression: MIT OR Apache-2.0
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
License-File: LICENSE-APACHE
|
|
15
|
-
Keywords: calibration,classification,clinical,diagnostic accuracy,evaluation,mAP,machine learning,metrics,object detection,regression,reproducibility,segmentation,statistical tests,statistics
|
|
3
|
+
Version: 0.6.1
|
|
16
4
|
Classifier: Development Status :: 5 - Production/Stable
|
|
17
|
-
Classifier: Intended Audience :: Developers
|
|
18
|
-
Classifier: Intended Audience :: Healthcare Industry
|
|
19
5
|
Classifier: Intended Audience :: Science/Research
|
|
6
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
7
|
+
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
8
|
+
Classifier: Topic :: Scientific/Engineering :: Image Recognition
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
20
10
|
Classifier: Operating System :: OS Independent
|
|
21
11
|
Classifier: Programming Language :: Python :: 3
|
|
22
12
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -26,51 +16,62 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
26
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
27
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
18
|
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Programming Language :: Rust
|
|
29
20
|
Classifier: Topic :: Scientific/Engineering
|
|
30
21
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
31
|
-
Classifier: Topic :: Scientific/Engineering :: Image Recognition
|
|
32
|
-
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
33
22
|
Classifier: Typing :: Typed
|
|
34
|
-
Requires-Python: >=3.9
|
|
35
23
|
Requires-Dist: numpy>=1.22
|
|
36
|
-
Requires-Dist: pandas>=1.4
|
|
37
24
|
Requires-Dist: scipy>=1.8
|
|
25
|
+
Requires-Dist: pandas>=1.4
|
|
26
|
+
Requires-Dist: matplotlib>=3.5 ; extra == 'all'
|
|
27
|
+
Requires-Dist: pillow>=9 ; extra == 'all'
|
|
28
|
+
Requires-Dist: nltk>=3.8 ; extra == 'all'
|
|
29
|
+
Requires-Dist: pytest>=7 ; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-cov>=4 ; extra == 'dev'
|
|
31
|
+
Requires-Dist: hypothesis>=6.80 ; extra == 'dev'
|
|
32
|
+
Requires-Dist: scikit-learn>=1.4 ; extra == 'dev'
|
|
33
|
+
Requires-Dist: statsmodels>=0.13 ; extra == 'dev'
|
|
34
|
+
Requires-Dist: matplotlib>=3.5 ; extra == 'dev'
|
|
35
|
+
Requires-Dist: pillow>=9 ; extra == 'dev'
|
|
36
|
+
Requires-Dist: pycocotools>=2.0.7 ; extra == 'dev'
|
|
37
|
+
Requires-Dist: nltk>=3.8 ; extra == 'dev'
|
|
38
|
+
Requires-Dist: sacrebleu>=2.4 ; extra == 'dev'
|
|
39
|
+
Requires-Dist: rouge-score>=0.1.2 ; extra == 'dev'
|
|
40
|
+
Requires-Dist: pycocoevalcap>=1.2 ; extra == 'dev'
|
|
41
|
+
Requires-Dist: jsonschema>=4.18 ; extra == 'dev'
|
|
42
|
+
Requires-Dist: choix>=0.3 ; extra == 'dev'
|
|
43
|
+
Requires-Dist: krippendorff>=0.6 ; extra == 'dev'
|
|
44
|
+
Requires-Dist: radon>=6 ; extra == 'dev'
|
|
45
|
+
Requires-Dist: pot>=0.9 ; python_full_version < '3.14' and extra == 'dev'
|
|
46
|
+
Requires-Dist: ranx>=0.3.19 ; python_full_version < '3.14' and extra == 'dev'
|
|
47
|
+
Requires-Dist: ruff>=0.6 ; extra == 'dev'
|
|
48
|
+
Requires-Dist: mypy>=1.10 ; extra == 'dev'
|
|
49
|
+
Requires-Dist: pandas-stubs ; extra == 'dev'
|
|
50
|
+
Requires-Dist: build ; extra == 'dev'
|
|
51
|
+
Requires-Dist: twine ; extra == 'dev'
|
|
52
|
+
Requires-Dist: pip-audit ; extra == 'dev'
|
|
53
|
+
Requires-Dist: nltk>=3.8 ; extra == 'llm'
|
|
54
|
+
Requires-Dist: matplotlib>=3.5 ; extra == 'plot'
|
|
55
|
+
Requires-Dist: pillow>=9 ; extra == 'vision'
|
|
38
56
|
Provides-Extra: all
|
|
39
|
-
Requires-Dist: matplotlib>=3.5; extra == 'all'
|
|
40
|
-
Requires-Dist: nltk>=3.8; extra == 'all'
|
|
41
|
-
Requires-Dist: pillow>=9; extra == 'all'
|
|
42
57
|
Provides-Extra: dev
|
|
43
|
-
Requires-Dist: build; extra == 'dev'
|
|
44
|
-
Requires-Dist: choix>=0.3; extra == 'dev'
|
|
45
|
-
Requires-Dist: hypothesis>=6.80; extra == 'dev'
|
|
46
|
-
Requires-Dist: jsonschema>=4.18; extra == 'dev'
|
|
47
|
-
Requires-Dist: krippendorff>=0.6; extra == 'dev'
|
|
48
|
-
Requires-Dist: matplotlib>=3.5; extra == 'dev'
|
|
49
|
-
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
50
|
-
Requires-Dist: nltk>=3.8; extra == 'dev'
|
|
51
|
-
Requires-Dist: pandas-stubs; extra == 'dev'
|
|
52
|
-
Requires-Dist: pillow>=9; extra == 'dev'
|
|
53
|
-
Requires-Dist: pip-audit; extra == 'dev'
|
|
54
|
-
Requires-Dist: pot>=0.9; (python_version < '3.14') and extra == 'dev'
|
|
55
|
-
Requires-Dist: pycocoevalcap>=1.2; extra == 'dev'
|
|
56
|
-
Requires-Dist: pycocotools>=2.0.7; extra == 'dev'
|
|
57
|
-
Requires-Dist: pytest-cov>=4; extra == 'dev'
|
|
58
|
-
Requires-Dist: pytest>=7; extra == 'dev'
|
|
59
|
-
Requires-Dist: radon>=6; extra == 'dev'
|
|
60
|
-
Requires-Dist: ranx>=0.3.19; (python_version < '3.14') and extra == 'dev'
|
|
61
|
-
Requires-Dist: rouge-score>=0.1.2; extra == 'dev'
|
|
62
|
-
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
63
|
-
Requires-Dist: sacrebleu>=2.4; extra == 'dev'
|
|
64
|
-
Requires-Dist: scikit-learn>=1.4; extra == 'dev'
|
|
65
|
-
Requires-Dist: statsmodels>=0.13; extra == 'dev'
|
|
66
|
-
Requires-Dist: twine; extra == 'dev'
|
|
67
58
|
Provides-Extra: llm
|
|
68
|
-
Requires-Dist: nltk>=3.8; extra == 'llm'
|
|
69
59
|
Provides-Extra: plot
|
|
70
|
-
Requires-Dist: matplotlib>=3.5; extra == 'plot'
|
|
71
60
|
Provides-Extra: vision
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
License-File: LICENSE
|
|
62
|
+
License-File: LICENSE-APACHE
|
|
63
|
+
Summary: A unified Python framework for machine-learning, clinical, statistical, segmentation, object-detection, uncertainty, and model evaluation.
|
|
64
|
+
Keywords: evaluation,metrics,segmentation,object detection,mAP,clinical,diagnostic accuracy,calibration,statistical tests,machine learning,statistics,classification,regression,reproducibility,rust
|
|
65
|
+
Author: Manoj Kumar C S, Nikhil D Bharadwaj
|
|
66
|
+
Maintainer: Manoj Kumar C S, Nikhil D Bharadwaj
|
|
67
|
+
License-Expression: MIT OR Apache-2.0
|
|
68
|
+
Requires-Python: >=3.9
|
|
69
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
70
|
+
Project-URL: Changelog, https://github.com/mkcs28/evalsuite-python/blob/main/CHANGELOG.md
|
|
71
|
+
Project-URL: Documentation, https://evalsuite-nine.vercel.app/docs
|
|
72
|
+
Project-URL: Homepage, https://evalsuite-nine.vercel.app
|
|
73
|
+
Project-URL: Issues, https://github.com/mkcs28/evalsuite-python/issues
|
|
74
|
+
Project-URL: Source, https://github.com/mkcs28/evalsuite-python
|
|
74
75
|
|
|
75
76
|
# EvalSuite
|
|
76
77
|
|
|
@@ -84,7 +85,11 @@ Description-Content-Type: text/markdown
|
|
|
84
85
|
EvalSuite brings classification, regression, clinical, statistical, segmentation and object-detection
|
|
85
86
|
evaluation into one consistent, validated, documented framework.
|
|
86
87
|
|
|
87
|
-
> **Status: stable (0.
|
|
88
|
+
> **Status: stable (0.6.1).** Every item on the 0.1.0–0.5.0 roadmaps is implemented and verified, including SPICE.
|
|
89
|
+
> **0.6 adds a compiled Rust core**: same API and identical results, with text metrics, COCO evaluation and
|
|
90
|
+
> bootstrap resampling several times faster and multithreaded (prebuilt wheels for Linux, macOS and Windows).
|
|
91
|
+
> 0.6.1 moves the whole COCO evaluation, CIDEr, CodeBLEU and distinct-n into the core and adds opt-in
|
|
92
|
+
> `resampling="native"` bootstrap draws.
|
|
88
93
|
> **LLM systems arrive in 0.5.0**: safety, robustness, calibration and uncertainty, agents and tool use,
|
|
89
94
|
> multilingual, code generation, long context and summarization, and inference efficiency and cost.
|
|
90
95
|
|
|
@@ -100,6 +105,19 @@ The package is installed as `evalsuite-python` and imported as `evalsuite`:
|
|
|
100
105
|
import evalsuite as es
|
|
101
106
|
```
|
|
102
107
|
|
|
108
|
+
EvalSuite has a **compiled core written in Rust**. pip installs a prebuilt wheel on Linux (x86_64, aarch64;
|
|
109
|
+
glibc and musl), macOS (Apple silicon, Intel) and Windows (x64, arm64) for Python 3.9 to 3.14, so no compiler
|
|
110
|
+
is needed. Anywhere else pip falls back to a pure-Python wheel that gives exactly the same results, more slowly.
|
|
111
|
+
`evalsuite._native.backend()` says which one is in use (`"rust"` or `"python"`), and
|
|
112
|
+
`EVALSUITE_PURE_PYTHON=1` selects the Python implementations on any install.
|
|
113
|
+
|
|
114
|
+
The core runs independent examples (sentences, images, classes, resamples) in parallel on all CPU cores; set
|
|
115
|
+
`EVALSUITE_NUM_THREADS` to cap the number of threads. Results never depend on the thread count: sums are always
|
|
116
|
+
taken in example order. Bootstrap functions (`bootstrap_ci`, `paired_bootstrap_test`, `compare`) accept
|
|
117
|
+
`resampling="native"` to draw resample indices in the core (seeded xoshiro256++): reproducible with
|
|
118
|
+
`random_state` and faster on large inputs, but a different random stream from the default NumPy one, so the
|
|
119
|
+
interval endpoints differ slightly (statistically equivalent).
|
|
120
|
+
|
|
103
121
|
## Why EvalSuite
|
|
104
122
|
|
|
105
123
|
- **One consistent API.** Every metric returns a result object that behaves like a number and exports to
|
|
@@ -340,50 +358,55 @@ Input files can be CSV, TSV, Parquet or JSON. Output format follows `--format` o
|
|
|
340
358
|
|
|
341
359
|
## Performance
|
|
342
360
|
|
|
343
|
-
Benchmarked against reference implementations on the same data (fastest of 5 runs; EvalSuite 0.
|
|
361
|
+
Benchmarked against reference implementations on the same data (fastest of 5 runs; EvalSuite 0.6.1, Python 3.13,
|
|
344
362
|
NumPy 2.5, Linux x86_64). **Overall: 81 of 81 rows agree with the reference** (largest
|
|
345
|
-
difference 2.5e-14),
|
|
346
|
-
|
|
363
|
+
difference 2.5e-14), 77 are faster (the other 4 are sub-millisecond or few-millisecond cases within timing noise,
|
|
364
|
+
0.89–0.99×), and the geometric-mean speed-up across all
|
|
365
|
+
27 cases and three sizes is **4.08×**. At 1,000,000 samples (pixels for
|
|
347
366
|
segmentation; 1,000 images for detection and 50 for Hausdorff; 10,000 examples for the LLM cases), in
|
|
348
367
|
alphabetical order:
|
|
349
368
|
|
|
350
369
|
| Case | Reference | EvalSuite (ms) | Reference (ms) | Speed-up |
|
|
351
370
|
| --- | --- | ---: | ---: | ---: |
|
|
352
|
-
| 10 classes: macro F1 | scikit-learn |
|
|
353
|
-
| agreement: Krippendorff's alpha, interval (4 raters × 10000 items) | krippendorff | 1.4 |
|
|
354
|
-
| binary: 8 label metrics via evaluate() | scikit-learn | 9.
|
|
355
|
-
| binary: ROC AUC | scikit-learn |
|
|
356
|
-
| calibration: slope and intercept | statsmodels |
|
|
357
|
-
| clinical: diagnostic report (7 CIs) | statsmodels |
|
|
358
|
-
| clinical: sensitivity, specificity, LR+, LR− | scikit-learn |
|
|
359
|
-
| decision curve: 99 thresholds | NumPy loop |
|
|
360
|
-
| detection: COCO evaluation (1000 images) | pycocotools |
|
|
361
|
-
| multiple testing: Hochberg (n p-values) | statsmodels |
|
|
362
|
-
| regression: MAE, MSE, RMSE, R² via evaluate() | scikit-learn |
|
|
363
|
-
| retrieval: MRR, MAP@20, NDCG@10 (10000 queries) | ranx |
|
|
364
|
-
| segmentation: Dice and IoU per class (n = pixels) | scikit-learn |
|
|
365
|
-
| segmentation: Hausdorff distance (50 images) | SciPy | 7.
|
|
366
|
-
| statistics: Cramér's V (5×5 table) | SciPy | 0.0 | 0.2 | **
|
|
367
|
-
| statistics: Mann–Whitney U | SciPy |
|
|
368
|
-
| statistics: Welch t-test | SciPy |
|
|
369
|
-
| structured: JSON Schema compliance (10000 documents) | jsonschema |
|
|
370
|
-
| systems: CodeBLEU n-gram terms (1000 programs) | codebleu |
|
|
371
|
-
| systems: confidence AUROC (n answers) | scikit-learn |
|
|
372
|
-
| systems: distribution-shift drop, Welch CI (n scores) | SciPy |
|
|
373
|
-
| systems: invalid tool calls vs JSON Schema (10000 tasks) | jsonschema |
|
|
374
|
-
| systems: latency p50 / p95 / p99 (n requests) | NumPy |
|
|
375
|
-
| systems: maintainability index (1000 programs) | radon |
|
|
376
|
-
| text: corpus BLEU and chrF (10000 sentences) | sacreBLEU |
|
|
377
|
-
| text: METEOR, exact and stem matches (10000 sentences) | NLTK |
|
|
378
|
-
| text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score |
|
|
371
|
+
| 10 classes: macro F1 | scikit-learn | 6.9 | 102.4 | **14.7×** |
|
|
372
|
+
| agreement: Krippendorff's alpha, interval (4 raters × 10000 items) | krippendorff | 1.4 | 3.3 | **2.4×** |
|
|
373
|
+
| binary: 8 label metrics via evaluate() | scikit-learn | 9.1 | 815.4 | **90.0×** |
|
|
374
|
+
| binary: ROC AUC | scikit-learn | 144.4 | 253.0 | **1.8×** |
|
|
375
|
+
| calibration: slope and intercept | statsmodels | 163.2 | 921.9 | **5.6×** |
|
|
376
|
+
| clinical: diagnostic report (7 CIs) | statsmodels | 4.3 | 4.5 | **1.0×** |
|
|
377
|
+
| clinical: sensitivity, specificity, LR+, LR− | scikit-learn | 17.1 | 312.0 | **18.2×** |
|
|
378
|
+
| decision curve: 99 thresholds | NumPy loop | 129.9 | 169.5 | **1.3×** |
|
|
379
|
+
| detection: COCO evaluation (1000 images) | pycocotools | 27.3 | 616.0 | **22.5×** |
|
|
380
|
+
| multiple testing: Hochberg (n p-values) | statsmodels | 85.8 | 82.8 | 0.97× |
|
|
381
|
+
| regression: MAE, MSE, RMSE, R² via evaluate() | scikit-learn | 5.6 | 9.3 | **1.7×** |
|
|
382
|
+
| retrieval: MRR, MAP@20, NDCG@10 (10000 queries) | ranx | 122.2 | 587.7 | **4.8×** |
|
|
383
|
+
| segmentation: Dice and IoU per class (n = pixels) | scikit-learn | 28.9 | 204.9 | **7.1×** |
|
|
384
|
+
| segmentation: Hausdorff distance (50 images) | SciPy | 7.0 | 13.5 | **1.9×** |
|
|
385
|
+
| statistics: Cramér's V (5×5 table) | SciPy | 0.0 | 0.2 | **12.1×** |
|
|
386
|
+
| statistics: Mann–Whitney U | SciPy | 109.9 | 331.5 | **3.0×** |
|
|
387
|
+
| statistics: Welch t-test | SciPy | 4.9 | 7.2 | **1.5×** |
|
|
388
|
+
| structured: JSON Schema compliance (10000 documents) | jsonschema | 95.3 | 224.5 | **2.4×** |
|
|
389
|
+
| systems: CodeBLEU n-gram terms (1000 programs) | codebleu | 324.0 | 521.4 | **1.6×** |
|
|
390
|
+
| systems: confidence AUROC (n answers) | scikit-learn | 168.4 | 278.7 | **1.7×** |
|
|
391
|
+
| systems: distribution-shift drop, Welch CI (n scores) | SciPy | 11.5 | 12.4 | **1.1×** |
|
|
392
|
+
| systems: invalid tool calls vs JSON Schema (10000 tasks) | jsonschema | 109.0 | 209.2 | **1.9×** |
|
|
393
|
+
| systems: latency p50 / p95 / p99 (n requests) | NumPy | 14.9 | 13.3 | 0.89× |
|
|
394
|
+
| systems: maintainability index (1000 programs) | radon | 89.8 | 97.2 | **1.1×** |
|
|
395
|
+
| text: corpus BLEU and chrF (10000 sentences) | sacreBLEU | 175.8 | 1965.7 | **11.2×** |
|
|
396
|
+
| text: METEOR, exact and stem matches (10000 sentences) | NLTK | 61.5 | 369.6 | **6.0×** |
|
|
397
|
+
| text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score | 153.9 | 617.2 | **4.0×** |
|
|
379
398
|
|
|
380
399
|
**Every metric is benchmarked too** (`evalsuite benchmark --suite metrics`): all 225 registered metrics and
|
|
381
400
|
statistics functions at 10,000 and 100,000 samples. 86 are compared with a reference library, 118 with an
|
|
382
401
|
independent textbook formula and 21 (learned, judge-dependent or randomised) are timed alone; **all 204
|
|
383
|
-
comparisons agree**, and against the libraries the geometric-mean speed-up is **
|
|
402
|
+
comparisons agree**, and against the libraries the geometric-mean speed-up is **6.32×** (172 of 172
|
|
384
403
|
measurements faster). Per-metric table in BENCHMARKS.md.
|
|
385
404
|
|
|
386
|
-
**Every
|
|
405
|
+
**Every substantial workload is faster than its reference.** The text metrics (BLEU, chrF, TER, ROUGE, METEOR, CIDEr,
|
|
406
|
+
CodeBLEU's n-gram terms, distinct-n), the whole COCO evaluation (IoU, score sort, matching, accumulation) and
|
|
407
|
+
bootstrap resampling run in the compiled, multithreaded Rust core; bootstrap intervals, paired bootstrap tests and
|
|
408
|
+
`compare()` evaluate confusion-matrix metrics from counts of each resample's (true, predicted) pairs instead of
|
|
409
|
+
copies of the data. `evaluate()` validates inputs once and builds the confusion
|
|
387
410
|
matrix once for all metrics, and integer labels are encoded without sorting. The rank tests rank the data once
|
|
388
411
|
with a single unstable sort; t-tests, χ², Fisher and McNemar compute their statistics directly, and
|
|
389
412
|
Shapiro–Wilk caches its weights per sample size. Percentiles select exactly from a small bracketed window
|
|
@@ -460,13 +483,21 @@ throughput, token usage, cost, resource utilization, energy per request, request
|
|
|
460
483
|
|
|
461
484
|
## Development
|
|
462
485
|
|
|
486
|
+
Building from source needs a Rust toolchain ([rustup](https://rustup.rs)); the compiled core is in `rust/`
|
|
487
|
+
(`evalsuite-core`, pure Rust, and `evalsuite-py`, the PyO3 bindings), built by maturin.
|
|
488
|
+
|
|
463
489
|
```bash
|
|
464
490
|
python -m venv .venv && source .venv/bin/activate
|
|
465
|
-
pip install -e ".[dev]"
|
|
491
|
+
pip install -e ".[dev]" # builds the Rust core into evalsuite._core
|
|
466
492
|
pytest --cov=evalsuite
|
|
493
|
+
EVALSUITE_PURE_PYTHON=1 pytest -q # the same suite without the compiled core
|
|
467
494
|
ruff check . && ruff format --check . && mypy
|
|
495
|
+
cargo test --manifest-path rust/Cargo.toml -p evalsuite-core
|
|
468
496
|
```
|
|
469
497
|
|
|
498
|
+
Every compiled kernel is a port of a Python implementation that stays in the package as the reference and
|
|
499
|
+
fallback; `tests/test_native.py` checks that the two give identical results. See CONTRIBUTING.md.
|
|
500
|
+
|
|
470
501
|
## Links
|
|
471
502
|
|
|
472
503
|
- PyPI: https://pypi.org/project/evalsuite-python/
|
|
@@ -486,3 +517,4 @@ Dual-licensed under either of
|
|
|
486
517
|
|
|
487
518
|
at your option. Unless you explicitly state otherwise, any contribution you submit for inclusion in this
|
|
488
519
|
project shall be dual-licensed as above, without any additional terms or conditions.
|
|
520
|
+
|
|
@@ -10,7 +10,11 @@
|
|
|
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.
|
|
13
|
+
> **Status: stable (0.6.1).** Every item on the 0.1.0–0.5.0 roadmaps is implemented and verified, including SPICE.
|
|
14
|
+
> **0.6 adds a compiled Rust core**: same API and identical results, with text metrics, COCO evaluation and
|
|
15
|
+
> bootstrap resampling several times faster and multithreaded (prebuilt wheels for Linux, macOS and Windows).
|
|
16
|
+
> 0.6.1 moves the whole COCO evaluation, CIDEr, CodeBLEU and distinct-n into the core and adds opt-in
|
|
17
|
+
> `resampling="native"` bootstrap draws.
|
|
14
18
|
> **LLM systems arrive in 0.5.0**: safety, robustness, calibration and uncertainty, agents and tool use,
|
|
15
19
|
> multilingual, code generation, long context and summarization, and inference efficiency and cost.
|
|
16
20
|
|
|
@@ -26,6 +30,19 @@ The package is installed as `evalsuite-python` and imported as `evalsuite`:
|
|
|
26
30
|
import evalsuite as es
|
|
27
31
|
```
|
|
28
32
|
|
|
33
|
+
EvalSuite has a **compiled core written in Rust**. pip installs a prebuilt wheel on Linux (x86_64, aarch64;
|
|
34
|
+
glibc and musl), macOS (Apple silicon, Intel) and Windows (x64, arm64) for Python 3.9 to 3.14, so no compiler
|
|
35
|
+
is needed. Anywhere else pip falls back to a pure-Python wheel that gives exactly the same results, more slowly.
|
|
36
|
+
`evalsuite._native.backend()` says which one is in use (`"rust"` or `"python"`), and
|
|
37
|
+
`EVALSUITE_PURE_PYTHON=1` selects the Python implementations on any install.
|
|
38
|
+
|
|
39
|
+
The core runs independent examples (sentences, images, classes, resamples) in parallel on all CPU cores; set
|
|
40
|
+
`EVALSUITE_NUM_THREADS` to cap the number of threads. Results never depend on the thread count: sums are always
|
|
41
|
+
taken in example order. Bootstrap functions (`bootstrap_ci`, `paired_bootstrap_test`, `compare`) accept
|
|
42
|
+
`resampling="native"` to draw resample indices in the core (seeded xoshiro256++): reproducible with
|
|
43
|
+
`random_state` and faster on large inputs, but a different random stream from the default NumPy one, so the
|
|
44
|
+
interval endpoints differ slightly (statistically equivalent).
|
|
45
|
+
|
|
29
46
|
## Why EvalSuite
|
|
30
47
|
|
|
31
48
|
- **One consistent API.** Every metric returns a result object that behaves like a number and exports to
|
|
@@ -266,50 +283,55 @@ Input files can be CSV, TSV, Parquet or JSON. Output format follows `--format` o
|
|
|
266
283
|
|
|
267
284
|
## Performance
|
|
268
285
|
|
|
269
|
-
Benchmarked against reference implementations on the same data (fastest of 5 runs; EvalSuite 0.
|
|
286
|
+
Benchmarked against reference implementations on the same data (fastest of 5 runs; EvalSuite 0.6.1, Python 3.13,
|
|
270
287
|
NumPy 2.5, Linux x86_64). **Overall: 81 of 81 rows agree with the reference** (largest
|
|
271
|
-
difference 2.5e-14),
|
|
272
|
-
|
|
288
|
+
difference 2.5e-14), 77 are faster (the other 4 are sub-millisecond or few-millisecond cases within timing noise,
|
|
289
|
+
0.89–0.99×), and the geometric-mean speed-up across all
|
|
290
|
+
27 cases and three sizes is **4.08×**. At 1,000,000 samples (pixels for
|
|
273
291
|
segmentation; 1,000 images for detection and 50 for Hausdorff; 10,000 examples for the LLM cases), in
|
|
274
292
|
alphabetical order:
|
|
275
293
|
|
|
276
294
|
| Case | Reference | EvalSuite (ms) | Reference (ms) | Speed-up |
|
|
277
295
|
| --- | --- | ---: | ---: | ---: |
|
|
278
|
-
| 10 classes: macro F1 | scikit-learn |
|
|
279
|
-
| agreement: Krippendorff's alpha, interval (4 raters × 10000 items) | krippendorff | 1.4 |
|
|
280
|
-
| binary: 8 label metrics via evaluate() | scikit-learn | 9.
|
|
281
|
-
| binary: ROC AUC | scikit-learn |
|
|
282
|
-
| calibration: slope and intercept | statsmodels |
|
|
283
|
-
| clinical: diagnostic report (7 CIs) | statsmodels |
|
|
284
|
-
| clinical: sensitivity, specificity, LR+, LR− | scikit-learn |
|
|
285
|
-
| decision curve: 99 thresholds | NumPy loop |
|
|
286
|
-
| detection: COCO evaluation (1000 images) | pycocotools |
|
|
287
|
-
| multiple testing: Hochberg (n p-values) | statsmodels |
|
|
288
|
-
| regression: MAE, MSE, RMSE, R² via evaluate() | scikit-learn |
|
|
289
|
-
| retrieval: MRR, MAP@20, NDCG@10 (10000 queries) | ranx |
|
|
290
|
-
| segmentation: Dice and IoU per class (n = pixels) | scikit-learn |
|
|
291
|
-
| segmentation: Hausdorff distance (50 images) | SciPy | 7.
|
|
292
|
-
| statistics: Cramér's V (5×5 table) | SciPy | 0.0 | 0.2 | **
|
|
293
|
-
| statistics: Mann–Whitney U | SciPy |
|
|
294
|
-
| statistics: Welch t-test | SciPy |
|
|
295
|
-
| structured: JSON Schema compliance (10000 documents) | jsonschema |
|
|
296
|
-
| systems: CodeBLEU n-gram terms (1000 programs) | codebleu |
|
|
297
|
-
| systems: confidence AUROC (n answers) | scikit-learn |
|
|
298
|
-
| systems: distribution-shift drop, Welch CI (n scores) | SciPy |
|
|
299
|
-
| systems: invalid tool calls vs JSON Schema (10000 tasks) | jsonschema |
|
|
300
|
-
| systems: latency p50 / p95 / p99 (n requests) | NumPy |
|
|
301
|
-
| systems: maintainability index (1000 programs) | radon |
|
|
302
|
-
| text: corpus BLEU and chrF (10000 sentences) | sacreBLEU |
|
|
303
|
-
| text: METEOR, exact and stem matches (10000 sentences) | NLTK |
|
|
304
|
-
| text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score |
|
|
296
|
+
| 10 classes: macro F1 | scikit-learn | 6.9 | 102.4 | **14.7×** |
|
|
297
|
+
| agreement: Krippendorff's alpha, interval (4 raters × 10000 items) | krippendorff | 1.4 | 3.3 | **2.4×** |
|
|
298
|
+
| binary: 8 label metrics via evaluate() | scikit-learn | 9.1 | 815.4 | **90.0×** |
|
|
299
|
+
| binary: ROC AUC | scikit-learn | 144.4 | 253.0 | **1.8×** |
|
|
300
|
+
| calibration: slope and intercept | statsmodels | 163.2 | 921.9 | **5.6×** |
|
|
301
|
+
| clinical: diagnostic report (7 CIs) | statsmodels | 4.3 | 4.5 | **1.0×** |
|
|
302
|
+
| clinical: sensitivity, specificity, LR+, LR− | scikit-learn | 17.1 | 312.0 | **18.2×** |
|
|
303
|
+
| decision curve: 99 thresholds | NumPy loop | 129.9 | 169.5 | **1.3×** |
|
|
304
|
+
| detection: COCO evaluation (1000 images) | pycocotools | 27.3 | 616.0 | **22.5×** |
|
|
305
|
+
| multiple testing: Hochberg (n p-values) | statsmodels | 85.8 | 82.8 | 0.97× |
|
|
306
|
+
| regression: MAE, MSE, RMSE, R² via evaluate() | scikit-learn | 5.6 | 9.3 | **1.7×** |
|
|
307
|
+
| retrieval: MRR, MAP@20, NDCG@10 (10000 queries) | ranx | 122.2 | 587.7 | **4.8×** |
|
|
308
|
+
| segmentation: Dice and IoU per class (n = pixels) | scikit-learn | 28.9 | 204.9 | **7.1×** |
|
|
309
|
+
| segmentation: Hausdorff distance (50 images) | SciPy | 7.0 | 13.5 | **1.9×** |
|
|
310
|
+
| statistics: Cramér's V (5×5 table) | SciPy | 0.0 | 0.2 | **12.1×** |
|
|
311
|
+
| statistics: Mann–Whitney U | SciPy | 109.9 | 331.5 | **3.0×** |
|
|
312
|
+
| statistics: Welch t-test | SciPy | 4.9 | 7.2 | **1.5×** |
|
|
313
|
+
| structured: JSON Schema compliance (10000 documents) | jsonschema | 95.3 | 224.5 | **2.4×** |
|
|
314
|
+
| systems: CodeBLEU n-gram terms (1000 programs) | codebleu | 324.0 | 521.4 | **1.6×** |
|
|
315
|
+
| systems: confidence AUROC (n answers) | scikit-learn | 168.4 | 278.7 | **1.7×** |
|
|
316
|
+
| systems: distribution-shift drop, Welch CI (n scores) | SciPy | 11.5 | 12.4 | **1.1×** |
|
|
317
|
+
| systems: invalid tool calls vs JSON Schema (10000 tasks) | jsonschema | 109.0 | 209.2 | **1.9×** |
|
|
318
|
+
| systems: latency p50 / p95 / p99 (n requests) | NumPy | 14.9 | 13.3 | 0.89× |
|
|
319
|
+
| systems: maintainability index (1000 programs) | radon | 89.8 | 97.2 | **1.1×** |
|
|
320
|
+
| text: corpus BLEU and chrF (10000 sentences) | sacreBLEU | 175.8 | 1965.7 | **11.2×** |
|
|
321
|
+
| text: METEOR, exact and stem matches (10000 sentences) | NLTK | 61.5 | 369.6 | **6.0×** |
|
|
322
|
+
| text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score | 153.9 | 617.2 | **4.0×** |
|
|
305
323
|
|
|
306
324
|
**Every metric is benchmarked too** (`evalsuite benchmark --suite metrics`): all 225 registered metrics and
|
|
307
325
|
statistics functions at 10,000 and 100,000 samples. 86 are compared with a reference library, 118 with an
|
|
308
326
|
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 **
|
|
327
|
+
comparisons agree**, and against the libraries the geometric-mean speed-up is **6.32×** (172 of 172
|
|
310
328
|
measurements faster). Per-metric table in BENCHMARKS.md.
|
|
311
329
|
|
|
312
|
-
**Every
|
|
330
|
+
**Every substantial workload is faster than its reference.** The text metrics (BLEU, chrF, TER, ROUGE, METEOR, CIDEr,
|
|
331
|
+
CodeBLEU's n-gram terms, distinct-n), the whole COCO evaluation (IoU, score sort, matching, accumulation) and
|
|
332
|
+
bootstrap resampling run in the compiled, multithreaded Rust core; bootstrap intervals, paired bootstrap tests and
|
|
333
|
+
`compare()` evaluate confusion-matrix metrics from counts of each resample's (true, predicted) pairs instead of
|
|
334
|
+
copies of the data. `evaluate()` validates inputs once and builds the confusion
|
|
313
335
|
matrix once for all metrics, and integer labels are encoded without sorting. The rank tests rank the data once
|
|
314
336
|
with a single unstable sort; t-tests, χ², Fisher and McNemar compute their statistics directly, and
|
|
315
337
|
Shapiro–Wilk caches its weights per sample size. Percentiles select exactly from a small bracketed window
|
|
@@ -386,13 +408,21 @@ throughput, token usage, cost, resource utilization, energy per request, request
|
|
|
386
408
|
|
|
387
409
|
## Development
|
|
388
410
|
|
|
411
|
+
Building from source needs a Rust toolchain ([rustup](https://rustup.rs)); the compiled core is in `rust/`
|
|
412
|
+
(`evalsuite-core`, pure Rust, and `evalsuite-py`, the PyO3 bindings), built by maturin.
|
|
413
|
+
|
|
389
414
|
```bash
|
|
390
415
|
python -m venv .venv && source .venv/bin/activate
|
|
391
|
-
pip install -e ".[dev]"
|
|
416
|
+
pip install -e ".[dev]" # builds the Rust core into evalsuite._core
|
|
392
417
|
pytest --cov=evalsuite
|
|
418
|
+
EVALSUITE_PURE_PYTHON=1 pytest -q # the same suite without the compiled core
|
|
393
419
|
ruff check . && ruff format --check . && mypy
|
|
420
|
+
cargo test --manifest-path rust/Cargo.toml -p evalsuite-core
|
|
394
421
|
```
|
|
395
422
|
|
|
423
|
+
Every compiled kernel is a port of a Python implementation that stays in the package as the reference and
|
|
424
|
+
fallback; `tests/test_native.py` checks that the two give identical results. See CONTRIBUTING.md.
|
|
425
|
+
|
|
396
426
|
## Links
|
|
397
427
|
|
|
398
428
|
- PyPI: https://pypi.org/project/evalsuite-python/
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
# The compiled core (Rust, in rust/) is built by maturin into evalsuite._core. Hatchling builds the same package
|
|
3
|
+
# without it (scripts/build_pure_wheel.py): the pure-Python fallback wheel for platforms without a binary wheel.
|
|
4
|
+
requires = ["maturin>=1.9,<2"]
|
|
5
|
+
build-backend = "maturin"
|
|
4
6
|
|
|
5
7
|
[project]
|
|
6
8
|
name = "evalsuite-python"
|
|
@@ -12,7 +14,7 @@ license-files = ["LICENSE", "LICENSE-APACHE"]
|
|
|
12
14
|
requires-python = ">=3.9"
|
|
13
15
|
authors = [{ name = "Manoj Kumar C S" }, { name = "Nikhil D Bharadwaj" }]
|
|
14
16
|
maintainers = [{ name = "Manoj Kumar C S" }, { name = "Nikhil D Bharadwaj" }]
|
|
15
|
-
keywords = ["evaluation", "metrics", "segmentation", "object detection", "mAP", "clinical", "diagnostic accuracy", "calibration", "statistical tests", "machine learning", "statistics", "classification", "regression", "reproducibility"]
|
|
17
|
+
keywords = ["evaluation", "metrics", "segmentation", "object detection", "mAP", "clinical", "diagnostic accuracy", "calibration", "statistical tests", "machine learning", "statistics", "classification", "regression", "reproducibility", "rust"]
|
|
16
18
|
classifiers = [
|
|
17
19
|
"Development Status :: 5 - Production/Stable",
|
|
18
20
|
"Intended Audience :: Science/Research",
|
|
@@ -29,6 +31,7 @@ classifiers = [
|
|
|
29
31
|
"Programming Language :: Python :: 3.12",
|
|
30
32
|
"Programming Language :: Python :: 3.13",
|
|
31
33
|
"Programming Language :: Python :: 3.14",
|
|
34
|
+
"Programming Language :: Rust",
|
|
32
35
|
"Topic :: Scientific/Engineering",
|
|
33
36
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
34
37
|
"Typing :: Typed",
|
|
@@ -82,6 +85,24 @@ path = "src/evalsuite/version.py"
|
|
|
82
85
|
|
|
83
86
|
[tool.hatch.build.targets.wheel]
|
|
84
87
|
packages = ["src/evalsuite"]
|
|
88
|
+
exclude = ["src/evalsuite/_core*.so", "src/evalsuite/_core*.pyd"]
|
|
89
|
+
|
|
90
|
+
[tool.maturin]
|
|
91
|
+
manifest-path = "rust/evalsuite-py/Cargo.toml"
|
|
92
|
+
python-source = "src"
|
|
93
|
+
module-name = "evalsuite._core"
|
|
94
|
+
profile = "release"
|
|
95
|
+
include = [
|
|
96
|
+
{ path = "tests/**/*", format = "sdist" },
|
|
97
|
+
{ path = "CHANGELOG.md", format = "sdist" },
|
|
98
|
+
{ path = "CONTRIBUTING.md", format = "sdist" },
|
|
99
|
+
{ path = "LICENSE-APACHE", format = "sdist" },
|
|
100
|
+
]
|
|
101
|
+
exclude = [
|
|
102
|
+
{ path = "**/__pycache__/**", format = "sdist" },
|
|
103
|
+
{ path = "**/*.pyc", format = "sdist" },
|
|
104
|
+
{ path = "rust/target/**", format = "sdist" },
|
|
105
|
+
]
|
|
85
106
|
|
|
86
107
|
[tool.hatch.build.targets.sdist]
|
|
87
108
|
include = ["src/evalsuite", "tests", "README.md", "LICENSE", "CHANGELOG.md", "CONTRIBUTING.md", "pyproject.toml"]
|