Skip to content

credibility.report

The outputs of a credibility assessment: the record, the tables and the report.

write_outputs writes an assessment into a directory of its own:

  • credibility.json: the assessment, see CredibilityAssessment.to_json.
  • contexts.tsv: one row per context of use with its level, influence, consequence, risk, verdict, the decisive and the evaluable points, the minimum of evaluable points, the uncovered quantities, whether it is verified and per acceptance rule, of the context and of the evidence extensions, its value (<name>) and limit (<name>_limit).
  • evidence.tsv: one row per context of use and evidence and per limitation (the limitations of the model with the context ""): the role, the points (n), mappings and studies, GMFE, AFE and the criteria.
  • domain.tsv: one row per context of use, field and value of the domain: whether it is claimed, its coverage and its points (n).
  • quantities.tsv: one row per context of use and quantity of interest: its description, whether it is a ratio, its coverage and its points.
  • verification.tsv: one row per context of use and check of the verification, empty if the assessment was not verified: the factor, the compared points (n), the largest relative difference and its point, whether the acceptance changed, whether the check passed and its problems; the checks of the battery are rows of every context of use.
  • uncertainty.tsv: one row per context of use and acceptance rule over the parameter draws of the adopted fits, empty without the propagation: the probability that the rule is met with its anytime-valid sequence, the decision of the statement at the threshold, the draws and the failed and needed draws.
  • uncertainty_quantities.tsv: one row per context of use and quantity of interest which is no ratio: the points, the median fold width of the prediction bands and their coverage of the observations.
  • uncertainty_sensitivity.tsv: one row per context of use, target (a quantity or a rule) and fitted parameter: the first-order index of the target over the parameter draws.
  • variability.tsv: one row per context of use with the predictive check of its decisive points with the declared variability of the subjects, empty without: the subjects, the parameter vectors, the points and the means of groups, the coverage with its Wilson interval, the expected coverage and the agreement.
  • variability_quantities.tsv: one row per context of use and quantity of interest which is no ratio: the points with a band and their coverage.
  • vpc.tsv: one row per data point of the adopted fits with the band of its predictive check, empty without: the subjects of the observation, the statistic, the typical prediction, the quantiles and whether it is inside.
  • cross_validation.tsv: one row per cross-validated adopted fit and held-out study: its points, the GMFE and the share within 2-fold of the held-out and of the fitted predictions, the cost of the refit.
  • battery.tsv: one row per check of the battery of the variants, empty if it did not run: the factor, the status, the cases, the largest deviation and where, the statement and the problems.
  • the tables of the evidence extensions (EvidenceExtension.report_tables) and of the battery hook (BatteryHook.report_tables), <name>.tsv.
  • index.html: the report (render_html), which extends report_base.html of sbmlsim.report.templates and loads nothing from the network.

print_summary prints the table of the contexts of use, their verdicts, the role of the evidence which decides them and the evaluable points with their minimum, and how many of them are verified.

contexts_table

contexts_table(assessment)

Get one row per context of use with the values and limits of its rules.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns id, title, level, influence, consequence,

DataFrame

risk, verdict, n_decisive, n_evaluable, minimum_points,

DataFrame

uncovered_quantities (the ids, comma separated, empty without),

DataFrame

verified (empty if the assessment was not verified) and per

DataFrame

acceptance rule, the rules of the extensions included, <name> and

DataFrame

<name>_limit, empty for a context without the rule.

evidence_table

evidence_table(assessment)

Get one row per evidence of a context of use and per limitation.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns context ("" for a limitation of the model), name,

DataFrame

role, selection, n (the points), n_mappings, n_studies,

DataFrame

outliers_dropped, limitation_subtracted and the metrics: GMFE, AFE,

DataFrame

the criteria and the values of the acceptance rules of the context,

DataFrame

empty if not evaluable.

domain_table

domain_table(assessment)

Get one row per context of use, field and value of its domain.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns context, field, value, claimed, coverage (empty

DataFrame

for a value outside the claim) and n, the points, see

DataFrame

CoverageEntry.

quantities_table

quantities_table(assessment)

Get one row per context of use and quantity of interest.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns context, quantity, description, ratio, coverage

DataFrame

(empty for a ratio without a pairing) and n_points, see

DataFrame

QuantityRecord.

verification_table

verification_table(assessment)

Get one row per context of use and check of the verification.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns of VERIFICATION_COLUMNS, see CheckRecord, the problems

DataFrame

joined by ;; no rows if the assessment was not verified.

uncertainty_table

uncertainty_table(assessment)

Get one row per context of use and rule over the parameter draws.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns of UNCERTAINTY_COLUMNS, see RuleProbability; no rows

DataFrame

without the propagation.

uncertainty_quantities_table

uncertainty_quantities_table(assessment)

Get one row per context of use and quantity with its prediction band.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns of UNCERTAINTY_QUANTITY_COLUMNS, see QuantityBand; no

DataFrame

rows without the propagation.

sensitivity_table

sensitivity_table(assessment)

Get one row per context of use, target and parameter of the draws.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns of SENSITIVITY_COLUMNS, see SensitivityIndex; no rows

DataFrame

without the propagation.

variability_table

variability_table(assessment)

Get one row per context of use with its predictive check.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns of VARIABILITY_COLUMNS, see VariabilityRecord, the

DataFrame

targets of the subjects and between the studies as `target

DataFrame

distributionjoined by;`; no rows without the predictive check.

variability_quantities_table

variability_quantities_table(assessment)

Get one row per context of use and quantity of its predictive check.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns context, quantity, n_points and coverage; no rows

DataFrame

without the predictive check.

vpc_table

vpc_table(assessment)

Get one row per data point of the adopted fits with its band.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns of VPC_COLUMNS, see VpcPoint; no rows without the

DataFrame

predictive check.

cross_validation_table

cross_validation_table(assessment)

Get one row per cross-validated fit and held-out study.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns fit, subset and the fields of HeldOutStudy; no rows

DataFrame

without a cross-validation.

battery_table

battery_table(assessment)

Get one row per check of the battery of the variants of the model.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required

Returns:

Type Description
DataFrame

The columns of BATTERY_COLUMNS, see BatteryResult, the problems

DataFrame

joined by ;; no rows if the battery did not run.

render_html

render_html(assessment, extensions=(), hook=None)

Render the report of an assessment.

The template credibility.html of sbmlsim extends report_base.html. The sections: the overview (the contexts of use and the limitations of the model), one card per context of use, the limitations, the unclaimed validation data, the verification, the cross-validation, the sections of the extensions and the provenance. The blocks of an extension in the card of a context follow the block of the core they name (EvidenceExtension.context_report_blocks); without extensions the report shows the core alone.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required
extensions Sequence[EvidenceExtension]

the evidence extensions of the project, in their order.

()
hook BatteryHook | None

the battery hook of the project, whose HTML follows the table of the battery.

None

Returns:

Type Description
str

The HTML of the report.

write_outputs

write_outputs(
    assessment, output_dir, extensions=(), hook=None
)

Write the record, the tables and the report of an assessment.

A directory of the outputs is replaced as a whole, so no file of an earlier assessment is left; a directory is one when it holds credibility.json. The outputs are rendered before anything is removed. The entries of the directory are removed and the directory itself is kept: windows refuses to remove or rename a directory which a process has open, e.g. as its working directory or in an explorer.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required
output_dir Path

the directory, created if missing.

required
extensions Sequence[EvidenceExtension]

the evidence extensions of the project, whose tables and blocks the outputs have.

()
hook BatteryHook | None

the battery hook of the project.

None

Returns:

Type Description
Path

The directory.

Raises:

Type Description
FileExistsError

if output_dir is a file or a non-empty directory without credibility.json.

ValueError

if a table of an extension takes the name of another output.

print_summary

print_summary(assessment)

Print the contexts of use and their verdicts on the console of sbmlsim.

Parameters:

Name Type Description Default
assessment CredibilityAssessment

the assessment.

required