robustmargin 0.1.1__py3-none-any.whl
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.
- robustmargin/__init__.py +90 -0
- robustmargin/censoring.py +652 -0
- robustmargin/empirical.py +348 -0
- robustmargin/intervals.py +785 -0
- robustmargin/models.py +2119 -0
- robustmargin/py.typed +0 -0
- robustmargin/ratio.py +941 -0
- robustmargin/report.py +650 -0
- robustmargin/schema/scorecard-v1.json +777 -0
- robustmargin/testing.py +465 -0
- robustmargin/threshold.py +631 -0
- robustmargin/types.py +541 -0
- robustmargin/validation.py +722 -0
- robustmargin-0.1.1.dist-info/METADATA +281 -0
- robustmargin-0.1.1.dist-info/RECORD +18 -0
- robustmargin-0.1.1.dist-info/WHEEL +5 -0
- robustmargin-0.1.1.dist-info/licenses/LICENSE +201 -0
- robustmargin-0.1.1.dist-info/top_level.txt +1 -0
robustmargin/__init__.py
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Robustness-margin estimation: thresholds with confidence intervals.
|
|
2
|
+
|
|
3
|
+
The package exports the vocabulary types (:class:`Axis`, :class:`Observations`,
|
|
4
|
+
:class:`Definition`, :class:`Cell`), the status and interval-shape enums (:class:`Status`,
|
|
5
|
+
:class:`IntervalShape`, alongside :class:`Censoring`), the result dataclasses (:class:`Fit`,
|
|
6
|
+
:class:`Threshold`, :class:`Ratio`, :class:`Scorecard`), the grid break-point rule
|
|
7
|
+
(:func:`grid_break_point`, returning :class:`GridBreakPoint`), and the dose-response fitter
|
|
8
|
+
(:func:`fit_dose_response`, returning a :class:`Fit` whose :meth:`~Fit.predict` returns a
|
|
9
|
+
:class:`Prediction`). The JSON report module (``robustmargin.report``) and the schema-valid test
|
|
10
|
+
fakes (``robustmargin.testing``) are importable as submodules but are not re-exported here.
|
|
11
|
+
|
|
12
|
+
:func:`threshold` solves for the severity at which a fitted curve crosses a target performance and
|
|
13
|
+
attaches an interval or an explicit censoring label, together with :class:`BaselineRate`,
|
|
14
|
+
:class:`ExactRates` and :func:`per_cell_clopper_pearson`.
|
|
15
|
+
|
|
16
|
+
:func:`ratio_interval` solves for the ratio of two thresholds' severities with a Fieller or
|
|
17
|
+
log-delta confidence interval.
|
|
18
|
+
|
|
19
|
+
:class:`Diagnostics` and :func:`diagnose` give model-only goodness of fit, dispersion and link
|
|
20
|
+
comparison for a converged :class:`Fit`. :class:`MonotonicityCheck`, :class:`AdjacentPair` and
|
|
21
|
+
:func:`check_monotonicity` are a data-only adjacent-severity-level check that needs only raw
|
|
22
|
+
counts, computed on every :func:`fit_dose_response` return path regardless of ``Status``. Both are
|
|
23
|
+
reported and never acted on automatically: neither changes a fitted parameter, a reported
|
|
24
|
+
threshold, or which link a caller chose.
|
|
25
|
+
|
|
26
|
+
Note that ``robustmargin.threshold`` is the *function*, not the submodule.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
from __future__ import annotations
|
|
30
|
+
|
|
31
|
+
from robustmargin.empirical import (
|
|
32
|
+
BaselineRate,
|
|
33
|
+
ExactRates,
|
|
34
|
+
GridBreakPoint,
|
|
35
|
+
grid_break_point,
|
|
36
|
+
per_cell_clopper_pearson,
|
|
37
|
+
)
|
|
38
|
+
from robustmargin.models import Covariance, Fit, Parameter, Prediction, fit_dose_response
|
|
39
|
+
from robustmargin.ratio import Ratio, ratio_interval
|
|
40
|
+
from robustmargin.report import Scorecard
|
|
41
|
+
from robustmargin.threshold import Threshold, threshold
|
|
42
|
+
from robustmargin.types import (
|
|
43
|
+
Axis,
|
|
44
|
+
Cell,
|
|
45
|
+
Censoring,
|
|
46
|
+
Definition,
|
|
47
|
+
IntervalShape,
|
|
48
|
+
Observations,
|
|
49
|
+
Status,
|
|
50
|
+
)
|
|
51
|
+
from robustmargin.validation import (
|
|
52
|
+
AdjacentPair,
|
|
53
|
+
Diagnostics,
|
|
54
|
+
MonotonicityCheck,
|
|
55
|
+
check_monotonicity,
|
|
56
|
+
diagnose,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
__version__ = "0.1.1"
|
|
60
|
+
|
|
61
|
+
__all__ = [
|
|
62
|
+
"AdjacentPair",
|
|
63
|
+
"Axis",
|
|
64
|
+
"BaselineRate",
|
|
65
|
+
"Cell",
|
|
66
|
+
"Censoring",
|
|
67
|
+
"Covariance",
|
|
68
|
+
"Definition",
|
|
69
|
+
"Diagnostics",
|
|
70
|
+
"ExactRates",
|
|
71
|
+
"Fit",
|
|
72
|
+
"GridBreakPoint",
|
|
73
|
+
"IntervalShape",
|
|
74
|
+
"MonotonicityCheck",
|
|
75
|
+
"Observations",
|
|
76
|
+
"Parameter",
|
|
77
|
+
"Prediction",
|
|
78
|
+
"Ratio",
|
|
79
|
+
"Scorecard",
|
|
80
|
+
"Status",
|
|
81
|
+
"Threshold",
|
|
82
|
+
"__version__",
|
|
83
|
+
"check_monotonicity",
|
|
84
|
+
"diagnose",
|
|
85
|
+
"fit_dose_response",
|
|
86
|
+
"grid_break_point",
|
|
87
|
+
"per_cell_clopper_pearson",
|
|
88
|
+
"ratio_interval",
|
|
89
|
+
"threshold",
|
|
90
|
+
]
|