credibility.scorecard¶
The credibility of many models at once: the scorecard and the pooling.
A repository of models assesses every model on its own; the scorecard reads
their records (credibility.json) into one table, one row per model and
context of use, and compares it with a stored baseline, so a change of the
shared library or of the data which makes a verdict or a metric worse shows
across all models at once (compare, a Regression each). The evidence
extensions of a project add columns to the scorecard
(sbmlsim.credibility.extensions.EvidenceExtension.scorecard_columns), judge
them against the baseline themselves (EvidenceExtension.regressions) and
pool their sections over the models (pool), e.g. the ratio pairs of all
models by a value of the metadata of their numerator arm.
Regression
dataclass
¶
A context of use of a model which got worse than its baseline.
Attributes:
| Name | Type | Description |
|---|---|---|
model |
str
|
the model. |
context |
str
|
the context of use. |
what |
str
|
what got worse: |
baseline |
str
|
the value of the baseline, as text. |
current |
str
|
the current value, as text. |
load_records
¶
Read the records of assessments, by the model of their provenance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
Iterable[Path]
|
records ( |
required |
Returns:
| Type | Description |
|---|---|
dict[str, CredibilityAssessment]
|
The assessments by model, sorted. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
if a path does not exist or no record is found. |
ValueError
|
if two records are of one model. |
scorecard
¶
Get one row per model and context of use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
records
|
Mapping[str, CredibilityAssessment]
|
the assessments by model. |
required |
extensions
|
Sequence[EvidenceExtension]
|
the evidence extensions, whose columns follow the columns of the core. |
()
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
The columns of |
DataFrame
|
verification, |
DataFrame
|
comma separated, |
DataFrame
|
the threshold probability over the parameter draws (False if one is |
DataFrame
|
shown below it, empty if one is undecided or without the |
DataFrame
|
propagation), |
DataFrame
|
prediction bands of the quantities, |
DataFrame
|
|
DataFrame
|
with the expected coverage, empty without the check), the columns of |
DataFrame
|
the extensions ( |
DataFrame
|
acceptance rule its value, the rules of the extensions included. |
compare
¶
Get the contexts of use which got worse than the baseline.
A context of the baseline which is missing is a regression, and so is a
worse verdict (VERDICT_RANK), a verified context which is no longer
verified, a context whose rules were robust over the parameter draws and
no longer are, the value of a rule of both which got worse by more than
the tolerance (a percentage by 100 * tolerance points, a GMFE by the
share tolerance, an AFE by tolerance further from 1) and what every
extension finds in its own columns (EvidenceExtension.regressions). A
value which is no longer evaluable is worse, a new context or rule is
none. The scorecards are compared by the names of their columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
baseline
|
DataFrame
|
a scorecard, see |
required |
current
|
DataFrame
|
the current scorecard. |
required |
tolerance
|
float
|
the change of a value which is no regression. |
TOLERANCE
|
extensions
|
Sequence[EvidenceExtension]
|
the evidence extensions, which judge their columns. |
()
|
Returns:
| Type | Description |
|---|---|
list[Regression]
|
The regressions, in the order of the baseline. |
pool
¶
Pool the sections of an extension over the contexts of use of the models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
records
|
Mapping[str, CredibilityAssessment]
|
the assessments by model. |
required |
extension
|
EvidenceExtension
|
the extension. |
required |
options
|
Mapping[str, Any] | None
|
the options of the pooling as the caller got them, e.g.
|
None
|
Returns:
| Type | Description |
|---|---|
DataFrame | None
|
The pooled table of the extension ( |
DataFrame | None
|
for an extension which pools nothing. |