evalsuite-python 0.1.0b1__tar.gz → 0.1.0b2__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 (56) hide show
  1. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/CHANGELOG.md +6 -0
  2. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/PKG-INFO +2 -2
  3. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/README.md +1 -1
  4. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/plot.py +9 -2
  5. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/version.py +1 -1
  6. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/output/test_plot.py +10 -0
  7. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/.gitignore +0 -0
  8. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/CONTRIBUTING.md +0 -0
  9. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/LICENSE +0 -0
  10. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/pyproject.toml +0 -0
  11. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/__init__.py +0 -0
  12. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/__main__.py +0 -0
  13. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/api.py +0 -0
  14. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/benchmarks.py +0 -0
  15. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/classification/__init__.py +0 -0
  16. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/classification/_common.py +0 -0
  17. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/classification/metrics.py +0 -0
  18. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/cli/__init__.py +0 -0
  19. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/cli/main.py +0 -0
  20. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/core/__init__.py +0 -0
  21. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/core/context.py +0 -0
  22. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/core/exceptions.py +0 -0
  23. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/core/export.py +0 -0
  24. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/core/registry.py +0 -0
  25. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/core/result.py +0 -0
  26. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/core/types.py +0 -0
  27. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/core/validation.py +0 -0
  28. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/py.typed +0 -0
  29. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/regression/__init__.py +0 -0
  30. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/regression/metrics.py +0 -0
  31. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/reporting.py +0 -0
  32. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/stats/__init__.py +0 -0
  33. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/stats/_resolve.py +0 -0
  34. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/stats/compare.py +0 -0
  35. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/stats/effect.py +0 -0
  36. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/stats/intervals.py +0 -0
  37. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/stats/paired.py +0 -0
  38. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/src/evalsuite/stats/results.py +0 -0
  39. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/__init__.py +0 -0
  40. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/classification/__init__.py +0 -0
  41. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/classification/test_against_sklearn.py +0 -0
  42. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/conftest.py +0 -0
  43. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/integration/__init__.py +0 -0
  44. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/output/__init__.py +0 -0
  45. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/output/test_benchmarks.py +0 -0
  46. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/output/test_cli.py +0 -0
  47. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/output/test_reporting.py +0 -0
  48. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/regression/__init__.py +0 -0
  49. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/regression/test_against_sklearn.py +0 -0
  50. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/stats/__init__.py +0 -0
  51. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/stats/test_branches.py +0 -0
  52. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/stats/test_compare.py +0 -0
  53. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/stats/test_reference.py +0 -0
  54. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/unit/__init__.py +0 -0
  55. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/unit/test_core.py +0 -0
  56. {evalsuite_python-0.1.0b1 → evalsuite_python-0.1.0b2}/tests/unit/test_edges.py +0 -0
@@ -6,6 +6,12 @@ All notable changes to this project are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.0b2]
10
+
11
+ ### Changed
12
+ - `es.plot.calibration`: the legend now sits below the axes by default so it no longer covers the
13
+ curves; new `legend_loc` argument (`"below"` or any matplotlib location).
14
+
9
15
  ## [0.1.0b1]
10
16
 
11
17
  Feature-complete for 0.1.0.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: evalsuite-python
3
- Version: 0.1.0b1
3
+ Version: 0.1.0b2
4
4
  Summary: A unified Python framework for machine-learning, clinical, statistical, segmentation, object-detection, uncertainty, and model evaluation.
5
5
  Project-URL: Homepage, https://evalsuite-nine.vercel.app
6
6
  Project-URL: Documentation, https://evalsuite-nine.vercel.app/docs
@@ -62,7 +62,7 @@ Description-Content-Type: text/markdown
62
62
  EvalSuite brings classification and regression metrics (with clinical, statistical, segmentation and
63
63
  object-detection evaluation on the roadmap) into one consistent, validated, documented framework.
64
64
 
65
- > **Status: beta (0.1.0b1).** Feature-complete for 0.1.0; the stable release follows once this beta is verified.
65
+ > **Status: beta (0.1.0b2).** Feature-complete for 0.1.0; the stable release follows once this beta is verified.
66
66
 
67
67
  ## Installation
68
68
 
@@ -10,7 +10,7 @@
10
10
  EvalSuite brings classification and regression metrics (with clinical, statistical, segmentation and
11
11
  object-detection evaluation on the roadmap) into one consistent, validated, documented framework.
12
12
 
13
- > **Status: beta (0.1.0b1).** Feature-complete for 0.1.0; the stable release follows once this beta is verified.
13
+ > **Status: beta (0.1.0b2).** Feature-complete for 0.1.0; the stable release follows once this beta is verified.
14
14
 
15
15
  ## Installation
16
16
 
@@ -190,9 +190,13 @@ def calibration(
190
190
  strategy: str = "uniform",
191
191
  pos_label: Any = None,
192
192
  sample_weight: Optional[ArrayLike] = None,
193
+ legend_loc: str = "below",
193
194
  ) -> Axes:
194
195
  """Reliability diagram: observed frequency against mean predicted probability per bin, with ECE and Brier
195
- score in the legend; the diagonal is perfect calibration."""
196
+ score in the legend; the diagonal is perfect calibration.
197
+
198
+ ``legend_loc="below"`` (default) puts the legend under the axes so it never covers the curves; any
199
+ matplotlib location (e.g. ``"upper left"``) places it inside instead."""
196
200
  from .classification.metrics import brier_score, calibration_curve, expected_calibration_error
197
201
 
198
202
  ax = _axes(ax)
@@ -218,7 +222,10 @@ def calibration(
218
222
  ylim=(-0.01, 1.01),
219
223
  )
220
224
  ax.set_aspect("equal")
221
- ax.legend(loc="upper left", frameon=False)
225
+ if legend_loc == "below":
226
+ ax.legend(loc="upper center", bbox_to_anchor=(0.5, -0.14), frameon=False, fontsize="small")
227
+ else:
228
+ ax.legend(loc=legend_loc, frameon=False) # type: ignore[call-overload]
222
229
  return ax
223
230
 
224
231
 
@@ -1,3 +1,3 @@
1
1
  """Package version (single source of truth, read by the build backend)."""
2
2
 
3
- __version__ = "0.1.0b1"
3
+ __version__ = "0.1.0b2"
@@ -121,3 +121,13 @@ def test_matplotlib_is_optional(monkeypatch) -> None:
121
121
  monkeypatch.setattr(builtins, "__import__", fake)
122
122
  with pytest.raises(es.OptionalDependencyError, match=r"evalsuite-python\[plot\]"):
123
123
  es.plot.roc([0, 1], [0.2, 0.8])
124
+
125
+
126
+ def test_calibration_legend_below_by_default_and_configurable():
127
+ y = np.array([0, 1, 0, 1, 1, 0, 1, 0])
128
+ p = np.array([0.1, 0.8, 0.3, 0.7, 0.9, 0.2, 0.6, 0.4])
129
+ ax = es.plot.calibration(y, p)
130
+ anchor = ax.get_legend().get_bbox_to_anchor().transformed(ax.transAxes.inverted())
131
+ assert anchor.y0 < 0 # outside, under the axes
132
+ ax2 = es.plot.calibration(y, p, legend_loc="upper left")
133
+ assert ax2.get_legend()._loc == 2