evalsuite-python 0.1.0a1__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.1.0a1/.gitignore +19 -0
- evalsuite_python-0.1.0a1/CHANGELOG.md +23 -0
- evalsuite_python-0.1.0a1/CONTRIBUTING.md +26 -0
- evalsuite_python-0.1.0a1/LICENSE +21 -0
- evalsuite_python-0.1.0a1/PKG-INFO +150 -0
- evalsuite_python-0.1.0a1/README.md +101 -0
- evalsuite_python-0.1.0a1/pyproject.toml +96 -0
- evalsuite_python-0.1.0a1/src/evalsuite/__init__.py +118 -0
- evalsuite_python-0.1.0a1/src/evalsuite/api.py +249 -0
- evalsuite_python-0.1.0a1/src/evalsuite/classification/__init__.py +47 -0
- evalsuite_python-0.1.0a1/src/evalsuite/classification/_common.py +111 -0
- evalsuite_python-0.1.0a1/src/evalsuite/classification/metrics.py +872 -0
- evalsuite_python-0.1.0a1/src/evalsuite/core/__init__.py +1 -0
- evalsuite_python-0.1.0a1/src/evalsuite/core/context.py +181 -0
- evalsuite_python-0.1.0a1/src/evalsuite/core/exceptions.py +52 -0
- evalsuite_python-0.1.0a1/src/evalsuite/core/registry.py +90 -0
- evalsuite_python-0.1.0a1/src/evalsuite/core/result.py +277 -0
- evalsuite_python-0.1.0a1/src/evalsuite/core/types.py +23 -0
- evalsuite_python-0.1.0a1/src/evalsuite/core/validation.py +202 -0
- evalsuite_python-0.1.0a1/src/evalsuite/py.typed +0 -0
- evalsuite_python-0.1.0a1/src/evalsuite/regression/__init__.py +41 -0
- evalsuite_python-0.1.0a1/src/evalsuite/regression/metrics.py +587 -0
- evalsuite_python-0.1.0a1/src/evalsuite/version.py +3 -0
- evalsuite_python-0.1.0a1/tests/__init__.py +0 -0
- evalsuite_python-0.1.0a1/tests/classification/__init__.py +0 -0
- evalsuite_python-0.1.0a1/tests/classification/test_against_sklearn.py +239 -0
- evalsuite_python-0.1.0a1/tests/conftest.py +18 -0
- evalsuite_python-0.1.0a1/tests/integration/__init__.py +0 -0
- evalsuite_python-0.1.0a1/tests/regression/__init__.py +0 -0
- evalsuite_python-0.1.0a1/tests/regression/test_against_sklearn.py +130 -0
- evalsuite_python-0.1.0a1/tests/unit/__init__.py +0 -0
- evalsuite_python-0.1.0a1/tests/unit/test_core.py +197 -0
- evalsuite_python-0.1.0a1/tests/unit/test_edges.py +231 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0a1]
|
|
10
|
+
|
|
11
|
+
First alpha, published to reserve the name and test the release pipeline. Distribution name
|
|
12
|
+
`evalsuite-python` (`pip install --pre evalsuite-python`), imported as `evalsuite`.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Core: input validation with actionable errors, exception hierarchy, immutable result objects with
|
|
17
|
+
JSON/pandas/Markdown/LaTeX export, metric registry (`list_metrics`, `metric_info`), and an evaluation
|
|
18
|
+
context that computes the confusion matrix once per evaluation.
|
|
19
|
+
- Classification metrics for binary, multiclass and multilabel targets with all averaging modes and
|
|
20
|
+
sample weights.
|
|
21
|
+
- Regression metrics for single- and multi-output targets with sample weights.
|
|
22
|
+
- `evaluate()` high-level API with task inference and default metric sets.
|
|
23
|
+
- Reference tests against scikit-learn and property-based tests; Python 3.9 to 3.13.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Contributing to EvalSuite
|
|
2
|
+
|
|
3
|
+
Thank you for helping. EvalSuite values correctness and clarity over breadth.
|
|
4
|
+
|
|
5
|
+
## Adding or changing a metric
|
|
6
|
+
|
|
7
|
+
1. Implement it with `@register(...)`: definition, formula, range, input requirements and at least one
|
|
8
|
+
reference.
|
|
9
|
+
2. Validate inputs through `evalsuite.core.validation`; raise `InputValidationError` for bad inputs and
|
|
10
|
+
`MetricInputError` for values outside the metric's domain, with a message saying how to fix it.
|
|
11
|
+
3. Test it: against an established implementation where definitions coincide (scikit-learn, SciPy), plus
|
|
12
|
+
hand-computed cases, edge cases and, where useful, property-based tests.
|
|
13
|
+
4. Document conventions explicitly (averaging, label order, zero division) and update `CHANGELOG.md`.
|
|
14
|
+
|
|
15
|
+
## Checks
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pytest --cov=evalsuite # coverage must stay at or above 95% for core modules
|
|
19
|
+
ruff check . && ruff format --check .
|
|
20
|
+
mypy # strict
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Reporting issues
|
|
24
|
+
|
|
25
|
+
Include the EvalSuite, Python and NumPy versions, a minimal example, the expected result (with a reference)
|
|
26
|
+
and the actual result.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Manoj Kumar C S
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: evalsuite-python
|
|
3
|
+
Version: 0.1.0a1
|
|
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
|
|
11
|
+
Maintainer: Manoj Kumar C S
|
|
12
|
+
License-Expression: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: classification,evaluation,machine learning,metrics,regression,reproducibility,statistics
|
|
15
|
+
Classifier: Development Status :: 3 - Alpha
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering
|
|
27
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
28
|
+
Classifier: Typing :: Typed
|
|
29
|
+
Requires-Python: >=3.9
|
|
30
|
+
Requires-Dist: numpy>=1.22
|
|
31
|
+
Requires-Dist: pandas>=1.4
|
|
32
|
+
Requires-Dist: scipy>=1.8
|
|
33
|
+
Provides-Extra: all
|
|
34
|
+
Requires-Dist: matplotlib>=3.5; extra == 'all'
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: build; extra == 'dev'
|
|
37
|
+
Requires-Dist: hypothesis>=6.80; extra == 'dev'
|
|
38
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
39
|
+
Requires-Dist: pandas-stubs; extra == 'dev'
|
|
40
|
+
Requires-Dist: pip-audit; extra == 'dev'
|
|
41
|
+
Requires-Dist: pytest-cov>=4; extra == 'dev'
|
|
42
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
43
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
44
|
+
Requires-Dist: scikit-learn>=1.2; extra == 'dev'
|
|
45
|
+
Requires-Dist: twine; extra == 'dev'
|
|
46
|
+
Provides-Extra: plot
|
|
47
|
+
Requires-Dist: matplotlib>=3.5; extra == 'plot'
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
|
|
50
|
+
# EvalSuite
|
|
51
|
+
|
|
52
|
+
[](https://github.com/mkcs28/evalsuite-python/actions/workflows/ci.yml)
|
|
53
|
+
[](https://pypi.org/project/evalsuite-python/)
|
|
54
|
+
[](https://pypi.org/project/evalsuite-python/)
|
|
55
|
+
[](LICENSE)
|
|
56
|
+
|
|
57
|
+
**Unified, reproducible evaluation for machine learning and research.**
|
|
58
|
+
|
|
59
|
+
EvalSuite brings classification and regression metrics (with clinical, statistical, segmentation and
|
|
60
|
+
object-detection evaluation on the roadmap) into one consistent, validated, documented framework.
|
|
61
|
+
|
|
62
|
+
> **Status: in development (v0.1.0 in progress).** The API may change before 0.1.0.
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install evalsuite-python
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The package is installed as `evalsuite-python` and imported as `evalsuite`:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import evalsuite as es
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Why EvalSuite
|
|
77
|
+
|
|
78
|
+
- **One consistent API.** Every metric returns a result object that behaves like a number and exports to
|
|
79
|
+
JSON, pandas, Markdown and LaTeX.
|
|
80
|
+
- **Explicit conventions.** Averaging, label order, the positive class and zero-division behaviour are stated
|
|
81
|
+
and recorded in every result, never silently assumed.
|
|
82
|
+
- **Validated.** Each metric is tested against scikit-learn where definitions coincide, plus property-based
|
|
83
|
+
tests and edge cases.
|
|
84
|
+
- **Documented.** Every metric carries its definition, formula, range, input requirements and references,
|
|
85
|
+
available programmatically through `metric_info()`.
|
|
86
|
+
- **Efficient.** `evaluate()` validates inputs once and computes the confusion matrix once for all metrics.
|
|
87
|
+
- **Lightweight.** Requires only NumPy, SciPy and pandas.
|
|
88
|
+
|
|
89
|
+
## Quick start
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import evalsuite as es
|
|
93
|
+
|
|
94
|
+
y_true = [0, 1, 1, 0, 1, 0]
|
|
95
|
+
y_pred = [0, 1, 0, 0, 1, 1]
|
|
96
|
+
y_prob = [0.1, 0.9, 0.4, 0.2, 0.8, 0.6]
|
|
97
|
+
|
|
98
|
+
result = es.evaluate(y_true, y_pred, y_prob=y_prob)
|
|
99
|
+
print(result.summary())
|
|
100
|
+
|
|
101
|
+
result["f1"] # MetricResult(f1=0.666667)
|
|
102
|
+
f"{result['mcc']:.3f}" # '0.333'
|
|
103
|
+
result.to_latex(caption="Test-set performance")
|
|
104
|
+
result.to_dataframe()
|
|
105
|
+
|
|
106
|
+
es.f1(y_true, y_pred) # individual metrics
|
|
107
|
+
es.roc_auc(y_true, y_prob)
|
|
108
|
+
es.metric_info("classification.mcc").formula # documentation
|
|
109
|
+
es.list_metrics("regression")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Metrics in this release
|
|
113
|
+
|
|
114
|
+
**Classification** (binary, multiclass, multilabel; micro/macro/weighted/samples/per-class averaging;
|
|
115
|
+
sample weights): accuracy, balanced accuracy, precision, recall, specificity, NPV, F1, F-beta, Jaccard,
|
|
116
|
+
MCC, Cohen's kappa (unweighted, linear, quadratic), Hamming loss, confusion matrix, ROC AUC (binary,
|
|
117
|
+
one-vs-rest, one-vs-one), average precision, ROC and PR curves, log loss, Brier score, top-k accuracy.
|
|
118
|
+
|
|
119
|
+
**Regression** (single and multi-output; sample weights): MAE, MSE, RMSE, R², adjusted R², MAPE, sMAPE,
|
|
120
|
+
MSLE, RMSLE, median absolute error, explained variance, max error, mean bias error, quantile (pinball)
|
|
121
|
+
loss, Huber loss, relative absolute error, relative squared error.
|
|
122
|
+
|
|
123
|
+
## Conventions
|
|
124
|
+
|
|
125
|
+
- `average="auto"` resolves to `"binary"` for binary targets and `"macro"` otherwise; the resolved value
|
|
126
|
+
is stored in `result.params["average"]`.
|
|
127
|
+
- Labels are sorted unless you pass `labels=[...]`; that order defines per-class outputs and the columns
|
|
128
|
+
of 2-D `y_prob`.
|
|
129
|
+
- Undefined ratios (zero denominators) return 0 **with an `UndefinedMetricWarning`**; pass
|
|
130
|
+
`zero_division=np.nan` to propagate NaN, or `0`/`1` to choose silently.
|
|
131
|
+
- Domain violations raise clear errors instead of being patched over (for example MAPE with zero targets).
|
|
132
|
+
|
|
133
|
+
## Development
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
python -m venv .venv && source .venv/bin/activate
|
|
137
|
+
pip install -e ".[dev]"
|
|
138
|
+
pytest --cov=evalsuite
|
|
139
|
+
ruff check . && ruff format --check . && mypy
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Links
|
|
143
|
+
|
|
144
|
+
- PyPI: https://pypi.org/project/evalsuite-python/
|
|
145
|
+
- Website and documentation: https://evalsuite-nine.vercel.app
|
|
146
|
+
- Website source: https://github.com/mkcs28/evalsuite
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# EvalSuite
|
|
2
|
+
|
|
3
|
+
[](https://github.com/mkcs28/evalsuite-python/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/evalsuite-python/)
|
|
5
|
+
[](https://pypi.org/project/evalsuite-python/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
**Unified, reproducible evaluation for machine learning and research.**
|
|
9
|
+
|
|
10
|
+
EvalSuite brings classification and regression metrics (with clinical, statistical, segmentation and
|
|
11
|
+
object-detection evaluation on the roadmap) into one consistent, validated, documented framework.
|
|
12
|
+
|
|
13
|
+
> **Status: in development (v0.1.0 in progress).** The API may change before 0.1.0.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install evalsuite-python
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The package is installed as `evalsuite-python` and imported as `evalsuite`:
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import evalsuite as es
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Why EvalSuite
|
|
28
|
+
|
|
29
|
+
- **One consistent API.** Every metric returns a result object that behaves like a number and exports to
|
|
30
|
+
JSON, pandas, Markdown and LaTeX.
|
|
31
|
+
- **Explicit conventions.** Averaging, label order, the positive class and zero-division behaviour are stated
|
|
32
|
+
and recorded in every result, never silently assumed.
|
|
33
|
+
- **Validated.** Each metric is tested against scikit-learn where definitions coincide, plus property-based
|
|
34
|
+
tests and edge cases.
|
|
35
|
+
- **Documented.** Every metric carries its definition, formula, range, input requirements and references,
|
|
36
|
+
available programmatically through `metric_info()`.
|
|
37
|
+
- **Efficient.** `evaluate()` validates inputs once and computes the confusion matrix once for all metrics.
|
|
38
|
+
- **Lightweight.** Requires only NumPy, SciPy and pandas.
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import evalsuite as es
|
|
44
|
+
|
|
45
|
+
y_true = [0, 1, 1, 0, 1, 0]
|
|
46
|
+
y_pred = [0, 1, 0, 0, 1, 1]
|
|
47
|
+
y_prob = [0.1, 0.9, 0.4, 0.2, 0.8, 0.6]
|
|
48
|
+
|
|
49
|
+
result = es.evaluate(y_true, y_pred, y_prob=y_prob)
|
|
50
|
+
print(result.summary())
|
|
51
|
+
|
|
52
|
+
result["f1"] # MetricResult(f1=0.666667)
|
|
53
|
+
f"{result['mcc']:.3f}" # '0.333'
|
|
54
|
+
result.to_latex(caption="Test-set performance")
|
|
55
|
+
result.to_dataframe()
|
|
56
|
+
|
|
57
|
+
es.f1(y_true, y_pred) # individual metrics
|
|
58
|
+
es.roc_auc(y_true, y_prob)
|
|
59
|
+
es.metric_info("classification.mcc").formula # documentation
|
|
60
|
+
es.list_metrics("regression")
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Metrics in this release
|
|
64
|
+
|
|
65
|
+
**Classification** (binary, multiclass, multilabel; micro/macro/weighted/samples/per-class averaging;
|
|
66
|
+
sample weights): accuracy, balanced accuracy, precision, recall, specificity, NPV, F1, F-beta, Jaccard,
|
|
67
|
+
MCC, Cohen's kappa (unweighted, linear, quadratic), Hamming loss, confusion matrix, ROC AUC (binary,
|
|
68
|
+
one-vs-rest, one-vs-one), average precision, ROC and PR curves, log loss, Brier score, top-k accuracy.
|
|
69
|
+
|
|
70
|
+
**Regression** (single and multi-output; sample weights): MAE, MSE, RMSE, R², adjusted R², MAPE, sMAPE,
|
|
71
|
+
MSLE, RMSLE, median absolute error, explained variance, max error, mean bias error, quantile (pinball)
|
|
72
|
+
loss, Huber loss, relative absolute error, relative squared error.
|
|
73
|
+
|
|
74
|
+
## Conventions
|
|
75
|
+
|
|
76
|
+
- `average="auto"` resolves to `"binary"` for binary targets and `"macro"` otherwise; the resolved value
|
|
77
|
+
is stored in `result.params["average"]`.
|
|
78
|
+
- Labels are sorted unless you pass `labels=[...]`; that order defines per-class outputs and the columns
|
|
79
|
+
of 2-D `y_prob`.
|
|
80
|
+
- Undefined ratios (zero denominators) return 0 **with an `UndefinedMetricWarning`**; pass
|
|
81
|
+
`zero_division=np.nan` to propagate NaN, or `0`/`1` to choose silently.
|
|
82
|
+
- Domain violations raise clear errors instead of being patched over (for example MAPE with zero targets).
|
|
83
|
+
|
|
84
|
+
## Development
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
python -m venv .venv && source .venv/bin/activate
|
|
88
|
+
pip install -e ".[dev]"
|
|
89
|
+
pytest --cov=evalsuite
|
|
90
|
+
ruff check . && ruff format --check . && mypy
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Links
|
|
94
|
+
|
|
95
|
+
- PyPI: https://pypi.org/project/evalsuite-python/
|
|
96
|
+
- Website and documentation: https://evalsuite-nine.vercel.app
|
|
97
|
+
- Website source: https://github.com/mkcs28/evalsuite
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.24"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "evalsuite-python"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "A unified Python framework for machine-learning, clinical, statistical, segmentation, object-detection, uncertainty, and model evaluation."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
authors = [{ name = "Manoj Kumar C S" }]
|
|
14
|
+
maintainers = [{ name = "Manoj Kumar C S" }]
|
|
15
|
+
keywords = ["evaluation", "metrics", "machine learning", "statistics", "classification", "regression", "reproducibility"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
28
|
+
"Topic :: Scientific/Engineering",
|
|
29
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
30
|
+
"Typing :: Typed",
|
|
31
|
+
]
|
|
32
|
+
dependencies = ["numpy>=1.22", "scipy>=1.8", "pandas>=1.4"]
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
plot = ["matplotlib>=3.5"]
|
|
36
|
+
all = ["matplotlib>=3.5"]
|
|
37
|
+
dev = [
|
|
38
|
+
"pytest>=7",
|
|
39
|
+
"pytest-cov>=4",
|
|
40
|
+
"hypothesis>=6.80",
|
|
41
|
+
"scikit-learn>=1.2",
|
|
42
|
+
"ruff>=0.6",
|
|
43
|
+
"mypy>=1.10",
|
|
44
|
+
"pandas-stubs",
|
|
45
|
+
"build",
|
|
46
|
+
"twine",
|
|
47
|
+
"pip-audit",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[project.urls]
|
|
51
|
+
Homepage = "https://evalsuite-nine.vercel.app"
|
|
52
|
+
Documentation = "https://evalsuite-nine.vercel.app/docs"
|
|
53
|
+
Source = "https://github.com/mkcs28/evalsuite-python"
|
|
54
|
+
Issues = "https://github.com/mkcs28/evalsuite-python/issues"
|
|
55
|
+
Changelog = "https://github.com/mkcs28/evalsuite-python/blob/main/CHANGELOG.md"
|
|
56
|
+
|
|
57
|
+
[project.scripts]
|
|
58
|
+
evalsuite = "evalsuite.cli.main:main"
|
|
59
|
+
|
|
60
|
+
[tool.hatch.version]
|
|
61
|
+
path = "src/evalsuite/version.py"
|
|
62
|
+
|
|
63
|
+
[tool.hatch.build.targets.wheel]
|
|
64
|
+
packages = ["src/evalsuite"]
|
|
65
|
+
|
|
66
|
+
[tool.hatch.build.targets.sdist]
|
|
67
|
+
include = ["src/evalsuite", "tests", "README.md", "LICENSE", "CHANGELOG.md", "CONTRIBUTING.md", "pyproject.toml"]
|
|
68
|
+
|
|
69
|
+
[tool.ruff]
|
|
70
|
+
line-length = 115
|
|
71
|
+
target-version = "py39"
|
|
72
|
+
src = ["src", "tests"]
|
|
73
|
+
|
|
74
|
+
[tool.ruff.lint]
|
|
75
|
+
select = ["E", "F", "I", "B", "UP", "N", "SIM", "NPY", "RUF", "S"]
|
|
76
|
+
# UP007/UP045: keep Optional[...] and Union[...] for clarity alongside Python 3.9 support.
|
|
77
|
+
ignore = ["N803", "N806", "RUF022", "UP007", "UP045", "RUF001", "RUF002", "RUF003"]
|
|
78
|
+
|
|
79
|
+
[tool.ruff.lint.per-file-ignores]
|
|
80
|
+
"tests/*" = ["S101", "N802", "E501"]
|
|
81
|
+
# Metric modules carry full literature references, which are not wrapped.
|
|
82
|
+
"src/evalsuite/*/metrics.py" = ["E501"]
|
|
83
|
+
|
|
84
|
+
[tool.mypy]
|
|
85
|
+
python_version = "3.10"
|
|
86
|
+
strict = true
|
|
87
|
+
files = ["src/evalsuite"]
|
|
88
|
+
|
|
89
|
+
[[tool.mypy.overrides]]
|
|
90
|
+
module = ["scipy.*", "matplotlib.*"]
|
|
91
|
+
ignore_missing_imports = true
|
|
92
|
+
|
|
93
|
+
[tool.pytest.ini_options]
|
|
94
|
+
testpaths = ["tests"]
|
|
95
|
+
addopts = "-q --strict-markers"
|
|
96
|
+
filterwarnings = ["error::RuntimeWarning"]
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""EvalSuite: unified, reproducible evaluation for machine learning and research.
|
|
2
|
+
|
|
3
|
+
>>> import evalsuite as es
|
|
4
|
+
>>> result = es.evaluate([0, 1, 1, 0], [0, 1, 0, 0])
|
|
5
|
+
>>> print(result.summary()) # doctest: +SKIP
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from . import classification, regression
|
|
9
|
+
from .api import evaluate
|
|
10
|
+
from .classification import (
|
|
11
|
+
accuracy,
|
|
12
|
+
average_precision,
|
|
13
|
+
balanced_accuracy,
|
|
14
|
+
brier_score,
|
|
15
|
+
cohen_kappa,
|
|
16
|
+
confusion_matrix,
|
|
17
|
+
f1,
|
|
18
|
+
fbeta,
|
|
19
|
+
hamming_loss,
|
|
20
|
+
jaccard,
|
|
21
|
+
log_loss,
|
|
22
|
+
mcc,
|
|
23
|
+
npv,
|
|
24
|
+
pr_curve,
|
|
25
|
+
precision,
|
|
26
|
+
recall,
|
|
27
|
+
roc_auc,
|
|
28
|
+
roc_curve,
|
|
29
|
+
specificity,
|
|
30
|
+
top_k_accuracy,
|
|
31
|
+
)
|
|
32
|
+
from .core.exceptions import (
|
|
33
|
+
EvalSuiteError,
|
|
34
|
+
InputValidationError,
|
|
35
|
+
MetricInputError,
|
|
36
|
+
OptionalDependencyError,
|
|
37
|
+
StatisticalTestError,
|
|
38
|
+
UndefinedMetricWarning,
|
|
39
|
+
UnsupportedTaskError,
|
|
40
|
+
)
|
|
41
|
+
from .core.registry import MetricInfo, list_metrics, metric_info
|
|
42
|
+
from .core.result import EvaluationResult, MetricResult
|
|
43
|
+
from .regression import (
|
|
44
|
+
adjusted_r2,
|
|
45
|
+
explained_variance,
|
|
46
|
+
huber_loss,
|
|
47
|
+
mae,
|
|
48
|
+
mape,
|
|
49
|
+
max_error,
|
|
50
|
+
mean_bias_error,
|
|
51
|
+
median_absolute_error,
|
|
52
|
+
mse,
|
|
53
|
+
msle,
|
|
54
|
+
quantile_loss,
|
|
55
|
+
r2,
|
|
56
|
+
rae,
|
|
57
|
+
rmse,
|
|
58
|
+
rmsle,
|
|
59
|
+
rse,
|
|
60
|
+
smape,
|
|
61
|
+
)
|
|
62
|
+
from .version import __version__
|
|
63
|
+
|
|
64
|
+
__all__ = [
|
|
65
|
+
"EvalSuiteError",
|
|
66
|
+
"EvaluationResult",
|
|
67
|
+
"InputValidationError",
|
|
68
|
+
"MetricInfo",
|
|
69
|
+
"MetricInputError",
|
|
70
|
+
"MetricResult",
|
|
71
|
+
"OptionalDependencyError",
|
|
72
|
+
"StatisticalTestError",
|
|
73
|
+
"UndefinedMetricWarning",
|
|
74
|
+
"UnsupportedTaskError",
|
|
75
|
+
"__version__",
|
|
76
|
+
"accuracy",
|
|
77
|
+
"adjusted_r2",
|
|
78
|
+
"average_precision",
|
|
79
|
+
"balanced_accuracy",
|
|
80
|
+
"brier_score",
|
|
81
|
+
"classification",
|
|
82
|
+
"cohen_kappa",
|
|
83
|
+
"confusion_matrix",
|
|
84
|
+
"evaluate",
|
|
85
|
+
"explained_variance",
|
|
86
|
+
"f1",
|
|
87
|
+
"fbeta",
|
|
88
|
+
"hamming_loss",
|
|
89
|
+
"huber_loss",
|
|
90
|
+
"jaccard",
|
|
91
|
+
"list_metrics",
|
|
92
|
+
"log_loss",
|
|
93
|
+
"mae",
|
|
94
|
+
"mape",
|
|
95
|
+
"max_error",
|
|
96
|
+
"mcc",
|
|
97
|
+
"mean_bias_error",
|
|
98
|
+
"median_absolute_error",
|
|
99
|
+
"metric_info",
|
|
100
|
+
"mse",
|
|
101
|
+
"msle",
|
|
102
|
+
"npv",
|
|
103
|
+
"pr_curve",
|
|
104
|
+
"precision",
|
|
105
|
+
"quantile_loss",
|
|
106
|
+
"r2",
|
|
107
|
+
"rae",
|
|
108
|
+
"recall",
|
|
109
|
+
"regression",
|
|
110
|
+
"rmse",
|
|
111
|
+
"rmsle",
|
|
112
|
+
"roc_auc",
|
|
113
|
+
"roc_curve",
|
|
114
|
+
"rse",
|
|
115
|
+
"smape",
|
|
116
|
+
"specificity",
|
|
117
|
+
"top_k_accuracy",
|
|
118
|
+
]
|